Combining offline and online #1389
Replies: 2 comments 3 replies
-
I think |
Beta Was this translation helpful? Give feedback.
-
Hi @ShaunBrassell, Another option is to create a PWA (Progresive Web Application), you could even use both technics (protocol and PWA). The main idea behind a PWA is a service worker that is called every time your application make a web request. This allow you to choose the best pattern (they are several) for your use case. As a sample, you can decide to verify if a connection is available and when you'r 'off' to get the request result from the cache and if the connection is 'on' let the request call the web site (api) and store the value on callback for later use. https://web.dev/learn/pwa/ ... just to provide a few! :-) The main problem with offline mbtiles is how are you reading the SQLite database? My option is to generate all the tiles as pbf files using : https://tilemaker.org/. This way you can even serve your tiles as files and save them locally! Hope this will help. |
Beta Was this translation helpful? Give feedback.
-
Am a bit of a noob with regards to Mapbox GL, but trying to figure out how to do the following: I have vector maps working great, but if the app starts in airplane mode, or if there is no signal, or only a portion of the map is displayed (or none at all), no matter how far you zoom out. And Its seems that previous caches are not there either.
I would like to at least serve some local offline mbtiles so if the user zooms out, then at least they will see a rough map. Maybe if the user views zoom level 0-6, use local files, 7+ use internet. Really just want to have an outline map there when there is no connectivity.
PS awesome library!
Beta Was this translation helpful? Give feedback.
All reactions