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

zoomToShowLayer fails after initial spiderfy. #286

Closed
sharkinsspatial opened this issue Dec 10, 2013 · 3 comments
Closed

zoomToShowLayer fails after initial spiderfy. #286

sharkinsspatial opened this issue Dec 10, 2013 · 3 comments

Comments

@sharkinsspatial
Copy link

As referenced in issue #203 and pull request #228, after a cluster is initially spiderfied zoomToShowLayer fails if the view extent has been changed by a method which does not collapse the cluster (such as panTo) as the layer._icon is still present due to zoomToShowLayer. You can reproduce this issue with this fiddle by clicking 'Zoom to marker', then 'Cause issue' and the 'Zoom to marker' again. There seems to be a pretty simple fix similar to that in #228 but you mentioned in #203 that we might want to look at it more deeply.

@danzel danzel closed this as completed in f0b1618 Dec 19, 2013
@Grsmto
Copy link

Grsmto commented Apr 11, 2014

Hi,

I'm commenting here cause I fell into a deep bug about the zoomToShowLayer function.

This is happening when all markers inside a cluster have the same position AND your initial map position is the same (centered on this cluster). The callback of zoomToShowLayer() is simply not called.
You can see an example of the bug here: http://jsfiddle.net/Grsmto/77DBE/5/

I'm looking for a fix and I'll try to do a PR if I find something, bug maybe you have an idea of how to fix this issue easily?

Grsmto pushed a commit to Grsmto/Leaflet.markercluster that referenced this issue Apr 11, 2014
danzel added a commit that referenced this issue Apr 15, 2014
danzel added a commit that referenced this issue Apr 15, 2014
@danzel
Copy link
Member

danzel commented Apr 15, 2014

@Grsmto Thanks, have added a fix for this, it should be a bit more reliable than just checking the center.

@Grsmto
Copy link

Grsmto commented Apr 15, 2014

@danzel Awesome, thank you! :)

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

3 participants