-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Show overzoomed raster tiles when loading a map at a zoom level greater than available raster tiles #4257
Comments
Oof, yeah this is a tricky one to solve so long as we cannot distinguish between invalid requests and missing tiles. Without a solution to that, my concern with falling back to lower zooms is that it would mean significantly more requests in situations where (a) there's a typo/error in the tile URL, or (b) you're looking at a map where one of your sources only has data covering a small area. 🤔 |
Counterpart to mapbox/mapbox-gl-native#8164 Directly loading a map that requires overzooming raster tiles only shows black at z16.50: Directly loading the map at z16.49 instead of z16.50 shows the satellite tiles (and you can now zoom in beyond z16.50 and still see tiles in this location), but when panning no new tiles will be loaded: |
@anandthakker what we do in gl-native is the following:
This is true for vector tiles, but not for raster tiles. Raster tiles can either be loaded, or they can't, but unlike vector tiles, there's no notion of "this raster tile exists but is empty".
I don't think this is a valid use case we should support; if you enter wrong URLs Mapbox GL just won't work and there's not much we can to about it.
This is a valid use case, and it's covered (at least partially) by the |
Thanks @kkaefer -- I'll check out the native implementation |
source |
is there now a solution? |
The link in the comment points to a LatLng that has added new satellite imagery and no longer reproduces this problem. It can still be seen at 16.74/11.45313/11.1671 though, using this link: https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v10.html?title=true&access_token=ACCESS_TOKEN#16.74/11.45313/11.1671 |
Is this functionality added as part of #5105? |
@andrewharvey Just tried out v0.43.0 and this doesn't seem to be addressed in #5105, unless I'm missing something. Tried two scenarios:
The former would be ideal for my use case. Otherwise monkey-patching |
When I visited the link from the original report here (after replacing the access_token), I notice after tile request failures it ascends the pyramid until it gets a tile successfully. Did that not work for you? |
@brianreavis The behavior @andrewharvey describes is what should be happening. If it doesn't do that, would you be able to provide us with a small example (e.g. JSFiddle) that exhibits this behavior? |
@andrewharvey @kkaefer Sorry for the delay! Here you go: https://jsfiddle.net/t8szL2wb/ In putting this together, I noticed that setting |
@brianreavis setting maxzoom on the layer will prevent tile requests above that zoom because the layer isn't shown above that zoom https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-maxzoom I think you should be setting the maxzoom on the source – if I change the fiddle to do this it behaves as expected and loads the highest-zoom parent tile available https://jsfiddle.net/t8szL2wb/ |
Thanks for the follow up @mollymerp! You're right, that's what I discovered in #4257 (comment). The second part of that comment was just referencing:
Which doesn't seem to be the case. Again, not a problem for me at all – but just thought I'd note it if there's anyone else coming to this thread from Google (using a discontinuous tileset for instance). Thanks for the work on #5105! |
mapbox-gl-js version: 0.32.0
Steps to Trigger Behavior
The tile requests 404 and the map is black.
However if you zoom out 4 times to z16 the tiles load, and then zoom back in 4 times to z20 the raster tiles show up overzoomed.
Expected Behavior
Initially loading at z20, the map should look the same as loading at z16 then zooming into z20.
Actual Behavior
Map is black.
Possible Solution
https://api.mapbox.com/v4/mapbox.satellite.json has a maxzoom of 22, but for this location the data is only there up to ~z16, so the solution can't just check the maxzoom value. It seems the solution here is if a raster source 404's, then try one zoom level up and repeat this until it returns data.
As raised in #1800, it might be better if the Mapbox API returned 204 No content responses rather than 404's so that only a 204 response would result in trying a lower zoom level.
Is this the best solution, would a PR solving it this way be accepted? Or is there a better solution?
The text was updated successfully, but these errors were encountered: