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

Support reversed zoom coordinates #406

Merged
merged 1 commit into from Feb 3, 2012
Merged

Support reversed zoom coordinates #406

merged 1 commit into from Feb 3, 2012

Conversation

Majiir
Copy link
Contributor

@Majiir Majiir commented Dec 26, 2011

This pull adds a zoomReverse option to the TileLayer class for reversing the order of zoom levels. The option is disabled by default.

@msingleton
Copy link

What's the use case here? Seems like this might be a rare enough request that it's better to be handled by your application rather than in the library

@Majiir
Copy link
Contributor Author

Majiir commented Jan 23, 2012

My application generates tiles with the zoom numbering reversed: level 4 is more zoomed-out than level 3. The world is infinite, so zoom level zero corresponds to 1 pixel = 1 meter, and higher/lower levels branch from there. As far as I can tell, other applications similar to mine use the same zoom indexing.

A more flexible method might involve a snap-in function for converting zoom/coordinates to a tile filename.

@JasonSanford
Copy link
Member

Yeah, I'm with @msingleton. It would probably be best to override L.TileLayer for your use case. Or maybe reversed zoom number is more common than I'm aware of?

@Majiir
Copy link
Contributor Author

Majiir commented Jan 23, 2012

This pull looks a little hackish, but I think that's more a reflection on how zoom numbering is handled in general; Leaflet isn't particularly elegant at handling either reversed or offset numbering schemes. At least in my case, there's an entire application domain where the numbering is both reversed and offset.

@mourner
Copy link
Member

mourner commented Feb 3, 2012

I agree that zoom number mapping in Leaflet should be done through a separate function which can be overriden, and since the reverseZoom option doesn't add much to the code anyway, it's useful enough to be merged. Thanks!

@mourner mourner merged commit 1f45ef7 into Leaflet:master Feb 3, 2012
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

Successfully merging this pull request may close these issues.

None yet

4 participants