PruneCluster icon indicating copy to clipboard operation
PruneCluster copied to clipboard

Setting spiderfier options

Open brunolellis opened this issue 9 years ago • 1 comments

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

brunolellis avatar Nov 26 '14 17:11 brunolellis

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.

fungiboletus avatar Dec 01 '14 14:12 fungiboletus