PruneCluster
PruneCluster copied to clipboard
Setting spiderfier options
I would like to change spiderfyDistanceMultiplier parameter because my icons are a little wide (about 120px).
What is the best option?
I thought about changing PruneClusterForLeaflet's initialize function to something like:
function(size: number = 120, clusterMargin: number = 20, spiderfyDistanceMultiplier: number = 1)
but then I must create an instance of PruneClusterForLeaflet passing size, clusterMargin and the new one.
Do you have any better suggestion?
I've created a plunker showing it: http://plnkr.co/edit/WmtpkEqSDJFuFeuiYP54?p=preview
Hi.
The simplest solution is something like this somewhere in your code:
PruneClusterLeafletSpiderfier.prototype.spiderfyDistanceMultiplier = 2;
But all the "spiderfiers" will use the same value. Adding an argument in the initialize method is a good idea. I think an argument object can be interesting too. It's now on the TODO list.