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

Zoom levels 1 less in GL than raster? #685

Closed
ashleyclough opened this issue Aug 11, 2014 · 8 comments
Closed

Zoom levels 1 less in GL than raster? #685

ashleyclough opened this issue Aug 11, 2014 · 8 comments

Comments

@ashleyclough
Copy link

It appears that the zoom levels reported in GL are 1 less than the same data source rendered as raster tiles. See the attached images of the same area as GL and in the Mapbox project view:

gl zoom 12
raster zoom 13

@incanus
Copy link
Contributor

incanus commented Aug 11, 2014

Yes, tiles are drawn in 512px of screen space on GL, so the zoom level retrieved is off by one.

@jfirebaugh
Copy link
Contributor

We had some extensive discussions about tile size and zoom level which we need to capture in documentation. If I recall correctly, the upshot is that this is the expected behavior: because GL renders 512px tiles, one tile at a given zoom level renders 4x the area as raster tiles, which have historically been 256px.

@ashleyclough
Copy link
Author

OK, makes sense, although I've always assumed the zoom value is just an arbitrary value. It does need documenting as it makes translating Mapbox Studio styles a bit more awkward - particularly as the data is exported using the 256px zoom references. How does it work with raster data?

@mourner mourner added this to the undecided milestone Aug 27, 2014
@mourner mourner added the docs label Aug 27, 2014
@jfirebaugh jfirebaugh modified the milestone: undecided Nov 4, 2014
@rouen-sk
Copy link

rouen-sk commented Jun 23, 2016

Just found about this issue and I am really surprised. This is not a "minor documentation issue" - you practically decided that Mapbox GL is not slippy map, and it is not compatible with other standardized slippy map things - for example any server side code using standard zoom-to-scale-denominator (13 = 1:100000). You cant use one common datasource-level filtering based on zoom for both raster and vector tiles, you need different styling rules, etc. What a huge standard-breaker... This should be like first thing mentioned in the documentation - in big bold font.

Is there perhaps any way to setup Mapbox GL JS to work in slippy maps mode? 256px tiles, standard zoom levels?

@timiyay
Copy link

timiyay commented Jun 23, 2016

Hmmmm, is there any chance this explains why I get incorrect results from mapbox/geo-viewport? mapbox/geo-viewport#3

I use Mapbox's Static Image API, and I need to compute the bounding box of those images. Mapbox Support advised me that geo-viewport was written for this very purpose.

If I request a static image at MapboxGL zoom 17, and then ask geo-viewport to compute this bounding box, it gives the bbox for zoom 16 instead. I have to +1 to get the right answer.

I'm trying to learn enough about the underlying mapbox/node-spherical-mercator library to make a fix, but it sounds like it's mostly a misunderstanding on my part. I had absolutely no idea that GL changed the game in terms of zoom levels.

I'm honestly not fussed about the zoom matching with raster-based zooms. I just need a way to compute the bbox of a Mapbox Static Map API image.

@lucaswoj lucaswoj modified the milestone: v1.0.0 Jun 29, 2016
@lucaswoj lucaswoj added the v1 label Jul 28, 2016
@lucaswoj lucaswoj removed this from the v1.0.0 milestone Jul 28, 2016
@lucaswoj
Copy link
Contributor

I am closing this issue because the GL team feels 👍 about this decision and does not plan to revisit.

@timiyay
Copy link

timiyay commented Jul 31, 2016

For posterity, the answer to my comment was:

Yes, the 512x512px tile size was the cause of my issue in mapbox/geo-viewport#3

@nrenner
Copy link

nrenner commented Oct 15, 2016

Documenting this in Mapbox GL JS fundamentals would be helpful.

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

8 participants