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

showTileBoundaries debug option should read from a source whose min/maxzoom include current zoom if available #4830

Closed
DanielCeregatti opened this issue Jun 13, 2017 · 2 comments · Fixed by #7314
Assignees

Comments

@DanielCeregatti
Copy link

mapbox-gl-js version: 0.38.0

Steps to Trigger Behavior

  1. Visit the openmaptiles style page, open the javascript console.
  2. Paste maps['osm-liberty'].showTileBoundaries = true; in the console.
  3. Note the red tile boundaries appear in osm-liberty map on that page. If you zoom that map beyond zoom 6 the tile boundaries disappear.

Expected Behavior

The boundary tiles should not disappear.

Actual Behavior

The boundary tiles disappear.

While the instructions above reference a page that's using mapbox-gl 0.31.0, I have a private test case that's using 0.38.0 that's exhibiting the same behavior. Unfortunately I can't link to it because it's behind firewalls.

I've opened a ticket on the style maker's github here: maputnik/osm-liberty#13. Here's a relevant excerpt from that ticket:

I found this out because I've copied this style to a map I'm working on as a proof-of-concept for the use of mapbox-gl for my company. I've noticed this problem is tied to the natural_earth layer in style.json. If I completely remove this layer definition and reload the page, setting showTileBoundaries = true does absolutely nothing. If I remove the source declaration for natural_earth_shaded_relief after removing the natural_earth layer, everything works as expected.

@lbud
Copy link
Contributor

lbud commented Jun 13, 2017

Thanks for the report @DanielCeregatti. This is happening because the code for rendering tile boundaries does so based on the first present source, which in the case of OSM Liberty is natural_earth_shaded_relief, with a maxzoom of 6. We should consider hardening this logic on the gl-js side, but on the OSM Liberty side, you could move the most complete source (in this case, openmaptiles) to be the first source listed in sources as a workaround for now.

@DanielCeregatti
Copy link
Author

DanielCeregatti commented Jun 13, 2017

Thanks @lbud! This solution worked. Considering this could technically still be considered a bug, I'm opting to leave this open, unless you object, in which case I'd be happy to close it.

@lbud lbud changed the title Tile boundaries stop at maxzoom of raster layer after setting showTileBoundaries = true showTileBoundaries debug option should read from a source whose min/maxzoom include current zoom if available Jun 15, 2017
@asheemmamoowala asheemmamoowala self-assigned this Jul 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants