jawj / OverlappingMarkerSpiderfier-Leaflet

Deals with overlapping markers in the Leaflet maps API, Google Earth-style
253 stars 68 forks source link

Configurable leg length #48

Open vladutc opened 4 years ago

vladutc commented 4 years ago

Hello!

Can we include a feature to configure the length of the spiderfy leg? Right now, we only have legWeight and it would help a lot if we would also have that as an option when creating the layer.

Thank you!

jawj commented 4 years ago

The parameters you're looking for are these, especially the xxxFootSeparation ones:

p['circleSpiralSwitchover'] = 9    # show spiral instead of circle from this marker count upwards
                                     # 0 -> always spiral; Infinity -> always circle
p['circleFootSeparation'] = 25     # related to circumference of circle
p['circleStartAngle'] = twoPi / 12
p['spiralFootSeparation'] = 28     # related to size of spiral (experiment!)
p['spiralLengthStart'] = 11        # ditto
p['spiralLengthFactor'] = 5        # ditto
magicmb commented 4 years ago

Yep that did the trick for me, although I was thinking the same as @vladutc since the docs for OverlappingMarkerSpiderfier-Leaflet only mention legWeight (default: 1.5) unlike the docs for OverlappingMarkerSpiderfier (OMS for Google Maps API v3) which cover all below mentioned options.

circleFootSeparation (default: 23), circleStartAngle (default: pi / 6),
spiralFootSeparation (default: 26), spiralLengthStart (default: 11), spiralLengthFactor (default: 4)

It's a good thing they also work in OverlappingMarkerSpiderfier-Leaflet 👍

PS Really great marker plugin for Leaflet by the way 😊 ​

The parameters you're looking for are these, especially the xxxFootSeparation ones:

p['circleSpiralSwitchover'] = 9    # show spiral instead of circle from this marker count upwards
                                     # 0 -> always spiral; Infinity -> always circle
p['circleFootSeparation'] = 25     # related to circumference of circle
p['circleStartAngle'] = twoPi / 12
p['spiralFootSeparation'] = 28     # related to size of spiral (experiment!)
p['spiralLengthStart'] = 11        # ditto
p['spiralLengthFactor'] = 5        # ditto