Closed michalgwo closed 1 month ago
Unable to reproduce with version 11.1.0 (although there shouldn't be any difference) and Raster DEM data gets loaded with MapTiler outdoor as expected.
The @2x
should only get added when the style has support for it (when the URL includes {ratio}
).
https://github.com/maplibre/maplibre-native/blob/main/src/mbgl/storage/resource.cpp#L113
I investigated this issue further, and it works on 11.1.0 (regardless of configuration, I will explain below). I forgot to mention that I was using the 10.2.0 version of MapLibre. For those who want to stick with the older version, I also figured out that the problem occurs only when I get the instance of Mapbox with all 3 parameters:
Mapbox.getInstance(this, "xxx", WellKnownTileServer.MapTiler)
But, when I skip apiKey and tileServer, everything works perfectly:
Mapbox.getInstance(this)
Thanks for sharing your solution.
Describe the bug When I try to use raster-dem type source, maplibre automatically adds
@2x
to link, which causes 404 error when the source doesn't support higher resolution source. For example MapTiler's outdoor style (https://api.maptiler.com/maps/outdoor-v2/style.json?key=xxx - to see the style you need API key, which you can get for free on https://www.maptiler.com/) hasterrain-rgb
sourceWhen I use this style in my app, it doesn't show any layer from this source and logs:
The 404 error happens because maptiler added
@2x
to link before.webp
what makes requests to non-existent url.To Reproduce Steps to reproduce the behavior:
Expected behavior Don't add
@2x
by default and/or make an option to toggle it.Platform information (please complete the following information):