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

viewreset event can reorder TileLayers #1422

Closed
jfirebaugh opened this issue Feb 19, 2013 · 3 comments
Closed

viewreset event can reorder TileLayers #1422

jfirebaugh opened this issue Feb 19, 2013 · 3 comments
Assignees
Labels
Milestone

Comments

@jfirebaugh
Copy link
Member

Suppose you have a TileLayer that gets stamped with ID 10, and a TileLayer that gets stamped with ID 1. You first add 10, then 1: the document order of the layer container elements should be, and is, 10, 1. Now a viewreset event is fired. This section of code is triggered. The iteration order for object properties is undefined. Chrome happens to iterate "1" before "10". Layer 1 is reset, causing its container to be reappended (tilePane.empty is true). Then layer 10 is reset, causing its container to be reappended. The result is a document order of 1, 10, the opposite of the correct order.

jfirebaugh added a commit to mapbox/mapbox.js that referenced this issue Feb 19, 2013
However, the opacity example still does not work correctly due
to a Leaflet bug (Leaflet/Leaflet#1422).
@mourner
Copy link
Member

mourner commented Feb 20, 2013

I'm currently refactoring tile layer zoom animation and that weird hacky stuff with empty etc. should go away, along with such issues (each tile layer will be animated independently).

@ghost ghost assigned mourner Feb 20, 2013
@mourner
Copy link
Member

mourner commented Feb 20, 2013

Done. Should be fixed by 40a824f, please check on your side just in case.

@mourner mourner closed this as completed Feb 20, 2013
@jfirebaugh
Copy link
Member Author

Confirmed, thanks @mourner.

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

No branches or pull requests

2 participants