maplibre / maplibre-native

MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms.
https://maplibre.org
BSD 2-Clause "Simplified" License
1.09k stars 321 forks source link

Tiles Offline Regions do not display while offline #633

Open mariusvn opened 1 year ago

mariusvn commented 1 year ago

Describe the bug The offline regions do not display in offline mode, even if the style is the same.

To Reproduce Steps to reproduce the behavior:

  1. Create an offline region definition of a style that contains a wms source and layer,
  2. download it
  3. set the map in offline mode
  4. go to the map that has the same style

Expected behavior The tiles should show even if the map is in offline mode or the phone disconnected from the network

Screenshots It's actually a black map since there is no tiles load

Platform information (please complete the following information):

Additional context I checked the internal database and it is populated nicely with all the tiles needed.

I insist on WMS style because I suspect a problem with the saving of raster tiles

mariusvn commented 1 year ago

anyone has the same problem with raster tiles ?

JRWilding commented 1 year ago

If tiles are invalidated they're never used, even if the device is offline and there isn't a way to validate them.

mustRevalidate is a flag thats stored in the tiles table in the database, and can be set by calling the invalidate api method, OR from the server using cache-control header (can't remember the exact details).

Maybe your tiles were invalidated?

There is a feature request to add the ability to ignore mustRevalidate if the device is offline, but it doesn't have much traction.

mariusvn commented 1 year ago

@JRWilding The offline tiles work only when used with TMS (only {x}, {y} and {z}) for some reason. I think this is due to a problem in the main maplibre repo since I analyzed the code carefully and nothing seems wrong now.

If you really need to use a WMS server, i suggest you to create an isolate with a proxy that convert TMS to WMS requests (I have done it in a project).

mariusvn commented 1 year ago

So yeah, for the follow up of this issue, there is a problem with offline regions and {bbox-epsg-3857}

NisargHB1831 commented 1 year ago

@louwers Do you have solution for using offline map in Maplibre 9.6.0 SDK. or how to apply the offline downloaded style on map. If you have any running example for same please let me know. Thanks