Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spiderfied icons are too close together making tapping individual ones difficult #100

Closed
stevevance opened this issue Dec 4, 2012 · 5 comments

Comments

@stevevance
Copy link

My use case is on a mobile device that accepts only finger taps. A cluster icon is shown. The user taps the cluster icon and the marker icons then spiderfy. A user taps one of the markers and the popup opens. A user attempts to tap a second marker that was in the same cluster but either pans the map or pops up the first marker because their tap didn't have the best aim (maybe they have fat fingers).

Or, the icons are placed too close together. Their distance from each other isn't based on icon size, which could potentially solve this problem.

Example image:
http://stevevance.net/files/spiderfy_twitter_icons.png

@danzel
Copy link
Member

danzel commented Dec 4, 2012

If you take a look at the top of MarkerCluster.Spiderfier.js there are some options related to how far away icons are placed.
We could make these options of the MarkerCluster, would be happy to accept a patch doing so :-)

@stevevance
Copy link
Author

I messed with all of those options in leaflet.markercluster-src.js and I didn't see a change in the map.

As for doing a patch, aside from hardcoding the variables, it would take me a long time to find how to make new options and make them available to the spiderfy classes (but my JS experience improves weekly).

@danzel
Copy link
Member

danzel commented Dec 4, 2012

Weird, I thought they'd do it.
I'll take a look.

@danzel danzel closed this as completed in bb92b17 Dec 4, 2012
@danzel
Copy link
Member

danzel commented Dec 4, 2012

Have added an option to MarkerClusterGroup: spiderfyDistanceMultiplier.
Set it to something bigger than 1 and when we spiderfy the markers will be further apart.
Tell me how it goes :)

@stevevance
Copy link
Author

Wow, I can be a doofus sometimes. I was modifying the -src.js file but forgot to change the reference in the HTML file. Anyway, thank you. This option works.

http://stevevance.net/files/spiderfy_twitter_icons_after.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants