-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Random acts of non-expansion when clicking on clusters #144
Comments
When you click a cluster it works out the bounds covered by its child markers, then zooms to those bounds. Try make your map bigger or reduce maxClusterRadius |
I am using user input (geocoder looked-up location and a variable distance) to decide what points to display on the map. I will not know how big the map will be or how many points are in the cluster from one map to the next. Shouldn't there be a test (on cluster click) to determine if the bounds of the markers do not require a zoom, but spiderfy anyway because the user clicked to expand the cluster? |
I'd like to add that I do not know javascript, so any suggestions to solve my issue that include code would be most appreciated! |
Yeah, we should probably always go down a zoom level or spiderfy when clicking a cluster. For now you could try decrease maxClusterRadius: Instead of var markers = new L.MarkerClusterGroup(); do: var markers = new L.MarkerClusterGroup({ maxClusterRadius: 50 }); (Default is 80) |
Thanks! I did as you suggested and set the maxClusterRadius to 50. The maps that I had tried previously are working as expected now, but logically, I can see that someone might put in search parameters, or be displaying the map on a mobile phone that changes the map pixel height/width and it will not work for the reasons you mentioned. I have to say I am very excited that this is basically working right now!~ Being new to GitHub, how will I know when you have implemented the "zoom or spiderfy on cluster click" feature so I don't have to override the default maxClusterRadius? |
I'll leave this bug open for that feature. So If you are getting emails from this one, then you'll get an email when its done :) |
Wonderful! |
finally implemented this :) |
I need help discovering why some clusters do not expand when clicked. There does not seem to be any logical reason for it that I can find. It is the same on all browsers and yes, I checked my mouse .
I made a screencast of the issue available here: http://www.screenr.com/Pfz7
I do get some warnings (no errors) in the console, but I get them for clusters that work correctly when clicked too.
Timestamp: 3/13/2013 1:49:26 PM
Warning: ReferenceError: reference to undefined property this._animRequest
Source File: http://localhost/migrate/sites/all/libraries/leaflet/dist/leaflet.js?v=0.4
Line: 7
Timestamp: 3/13/2013 1:49:26 PM
Warning: ReferenceError: reference to undefined property this._longPressTimeout
Source File: http://localhost/migrate/sites/all/libraries/leaflet/dist/leaflet.js?v=0.4
Line: 7
etc.
If I press the "+" button to zoom the map, then the clusters expand as expected, even the ones that don't when clicked.
The text was updated successfully, but these errors were encountered: