Skip to content

Zoom levels 1 less in GL than raster? #685

Closed

Description

@ashleyclough

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

Activity

  1. incanus commented on Aug 11, 2014

    @incanus
    Contributor

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

  2. jfirebaugh commented on Aug 11, 2014

    @jfirebaugh
    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.

  3. ashleyclough commented on Aug 11, 2014

    @ashleyclough
    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?

  4. added this to the milestone on Aug 27, 2014
  5. modified the milestone: on Nov 4, 2014
  6. rouen-sk commented on Jun 23, 2016

    @rouen-sk

    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?

  7. timiyay commented on Jun 23, 2016

    @timiyay

    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.

  8. modified the milestone: on Jun 29, 2016
  9. removed this from the milestone on Jul 28, 2016
  10. lucaswoj commented on Jul 28, 2016

    @lucaswoj
    Contributor

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

  11. timiyay commented on Jul 31, 2016

    @timiyay

    For posterity, the answer to my comment was:

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

  12. nrenner commented on Oct 15, 2016

    @nrenner

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions