-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
Add option to auto-detect maxzoom #3110
Comments
Perhaps also check |
I would recommend to set op a proxy with a Cloudflare Worker or AWS Lambda to return 404 instead of the Map data unavailable image. Adding this heuristic logic to the library sounds like a complicated solution for a very specific problem. Actually now that I think of it, you don't need a proxy, you can probably achieve the result by using a Custom Module provider that intercepts the HTTP response and turns it into a 404 if the dummy image is detected. #2231 |
Thanks for suggestion; although the proxy is not really useful as a solution in many cases, as it adds a cost1 (and maintenance/another SPOF) for an app developer where previously there were none. However, your suggestion for custom module provider might work, esp. seems relatively easy if TMS is hardcoded in app and single "fake tile" checksum can be precalculated. If TMS is custom, original idea is harder to implement, as it would not know when zoom was increased like MapLibre core could, but probably still doable via Custom Module HTTP provider. If somebody does it, it would be appreciated if they link their solution here! Tip For those interested, that specific Arcgisonline.com TMS server example mentioned in the original issue can be fixed with usage of Footnotes
|
Is your feature request related to a problem? Please describe.
When using raster satellite imagery (TMS), one has to specify
maxzoom
. It is fine if the TMS has the same maxzoom everywhere, but that is often not the case for e.g. satellite (and aerial) imagery where coverage has different details in different areas.E.g. https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer
in some places same
maxzoom=18
(or even up to 21) works just fine, while in other places maxzoom 18 is not available and it returns dummy image instead:That is extremely annoying to the user, who has to choose between 3 bad solutions:
maxzoom
once to maximum possibly supported level (e.g.21
), which causes abrupt changes from normal satellite imagery to dummy imagery when they zoom in too much in places where such zoom is not availablemaxzoom
once to minimum version supported everywhere on than TMS (17
or even down to13
), resulting in blurry low-detail images even in places where much higher resolution is offered by the TMSmaxzoom
depending where on the map they are the panning/zooming.(FYI, the App I'm using is SCEE, and here are relevant discussions: Helium314/SCEE#615 and PRs Helium314/SCEE#708. Here is the debug
.apk
if one wants to play with it -- one needs to enableSettings
/UI
/Quick settings button
to be able to switch to satellite imagery, and inSettings
/Data management
/Tile source for sattellite / aerial images
one can set tile URL and itsmaxzoom
)Describe the solution you'd like
I would like if MapLibre had an option to automatically detect when real
maxzoom
is exceeded and fallback to in-library scaling (like it does currently if e.g.maxzoom=17
is specified and user zooms to19
). It already does that if remote server provides HTTP404
error on invalid zooms, but not if it provides "fake" tile instead.I know TMS does not provide that information (which maxzoom is available in the area), but it could be autodetected with some heuristics (if app developer specifies they want such behaviour, of course):
maxzoom
for that area (there could be optional extra safety check here, e.g. try to download a single tile atnewcurrentzoom+1
, and see if that one is also the same)maxzoom
, implement in-library software scaling (like we currently do whenmaxzoom
was manually set to lower value then current map view zoom)Describe alternatives you've considered
See 3 alternatives listed above -- all have been tried and all are bad for user experience.
The third option (user must manually determine and change maxzoom) seems the best we can do currently without MapLibre help, but even when accompanied with a FAQ it requires not only users being advanced, but it also constantly annoys them with need to manually change setting if they cover more then a single area.
Additional context
The text was updated successfully, but these errors were encountered: