简体   繁体   中英

MapBox Android SDK: How to download offline map during app installation?

I am new to the development. At the moment I am working on Android app that is supposed to allow navigating offline. I am using MapBox SDK for this app.

Currently I am searching for how to download an offline region during app installation. As of now I have found solely examples on how to download a region while you are online. But is there a way to provide a chosen region from the start, so that a user isn't obliged to have internet connection to start using the app? And where are downloaded regions stored on the device?

Also Offline plugin seems a bit obscure - https://docs.mapbox.com/android/plugins/overview/offline/ I could not find many examples of its implementation.

I have already followed exemples from official documentation - https://docs.mapbox.com/android/maps/overview/offline/ But this doesn't solve my problem. As it shows downloading a region while being online.

Ideally I would love at the app launch to check connection and if offline, provide user with preloaded app (downloaded during app installation). If online update all resources at the background.

The type of implementation you're referring to is called “offline sideloading.” It is definitely possible as long as you're building with one of the more recent versions of the Maps SDK. This section of the documentation goes into greater detail on this process: https://docs.mapbox.com/android/maps/overview/offline/#offline-sideloading

⚠️ Disclaimer: I currently work for Mapbox ⚠️

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM