You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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?
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?
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.
Activity
incanus commentedon Aug 11, 2014
Yes, tiles are drawn in
512pxof screen space on GL, so the zoom level retrieved is off by one.jfirebaugh commentedon Aug 11, 2014
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 commentedon Aug 11, 2014
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?
rouen-sk commentedon 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 commentedon Jun 23, 2016
Hmmmm, is there any chance this explains why I get incorrect results from
mapbox/geo-viewport? mapbox/geo-viewport#3I use Mapbox's Static Image API, and I need to compute the bounding box of those images. Mapbox Support advised me that
geo-viewportwas written for this very purpose.If I request a static image at MapboxGL zoom 17, and then ask
geo-viewportto 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-mercatorlibrary 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 commentedon Jul 28, 2016
I am closing this issue because the GL team feels 👍 about this decision and does not plan to revisit.
timiyay commentedon 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 commentedon Oct 15, 2016
Documenting this in Mapbox GL JS fundamentals would be helpful.