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.35k stars 1.33k forks source link

Offline Download very slow #16527

Open georgbachmann opened 3 years ago

georgbachmann commented 3 years ago

Currently the SDK loads every single tile on it's own. In my opinion this is is quite bad in a lot of ways.

There is no way around that, right? I'd love to see an plug-able offline handling. Cause then I could pre-package larger areas on the server and make them available inside the app using my own offline-code...

But as I see it, that's currently not possible? Or am I missing something?

JRWilding commented 3 years ago

If you pre-package the tiles into a database file (sql with the correct schema) you can merge that db on the client with OfflineManager#mergeOfflineDatabaseFile or similar (thats on Android).

You could manually download the tiles and prepare the .db on the client, or (in your case) prepare the .db file on your own server and download it as 1 file.

I seem to remember that a tool to package the tiles exists but I can't remember if it was an official tool or something community made.