mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.34k stars 1.33k forks source link

Map going blank for missing tiles instead of zooming lower level tiles #16629

Open kuwapa opened 2 years ago

kuwapa commented 2 years ago

I hope this this is correct place to post this issue. This issue is happening on Mapbox Android SDK v9.6.2. I'm using my own tile server to serve vector tiles with openmaptiles style to the mapbox map. To achieve this, I've taken the openmaptiles style json and replaced the sources url with my own tileserver's url.

"tiles": [
    "http://localhost:7000/tiles/{z}/{x}/{y}"
  ]

For a certain requirement, I only need to load the entire planet's tile but only for zoom 0-5. So when the server receives a request for a tile for zoom 6 onwards it responds with a 404 error code and a simple message in the body. The problem is that when the map requests for tiles for zoom 6, it receives a 404 but shows a blank instead of simply zooming and expanding the zoom 5 tile. The first GIF is showing this behaviour -

However, after the zoom 5 tiles are loaded if I stop my server, when the map requests zoom 6 tiles, the server address is not resolved and zooming into the map zoom 5 tiles are expanded and a blank is not shown. This same behaviour is what I want the map to emulate even when the map receives a 404 from the server. How can I do this? The second GIF shows when I stop the server and zoom 5 tiles are expanded.

20211102_211335

20211102_211858

Thank you.

dinhnn commented 2 years ago

up