You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Some discussion I had with @kkaefer about what was needed for offline maps:
native core does not yet support support offline maps - on roadmap
The cache sqlite DB can be reused for storing tiles offline
need to add ability to swap out the cache database and set it to a read-only mode
need a tool that builds an offline database that can be distributed with the app/downloaded
could also download all individual tiles on first launch, however this is not good strategy
could be useful to have a way to differentially update only the tiles that have been changed. Like some sort of patch DB, that has higher priority than main DB, and can eventually be somehow merged into the main DB.
Removing label & editing title — this isn't specific to Android.
We've accomplished a lot of this in past across various toolsets on both iOS and Android.
MBTiles is a spec for raster or vector tiles as blobs in SQLite with a known format and metadata table. This is used for prebunding offline maps with an app. It's not designed for adding to later, but could be remedied in some way if this seems like a good idea.
MBTiles is a spec for raster or vector tiles as blobs in SQLite with a known format and metadata table. This is used for prebunding offline maps with an app. It's not designed for adding to later, but could be remedied in some way if this seems like a good idea.
Being able to push out small update datasets will be needed if people start creating maps of whole countries, e.g. topo maps for all of Australia or NZ cause it will be annoying to redownload hundreds of MBs of map data every time the dataset gets updated (NZ updates their topo data monthly)
function to calculate number of tiles needed for given bounding box and zoom range
function to start offline caching - will take bbox, zoom max & min, some sort of callback/interface to receive progress notifications
notification that receives - total number of tiles, tiles downloaded so far, number of failures (and possibly list of the failures), overall finished & successful indication
Storage format is a SQLite-based common store keyed on tile source, per the convention of the upstream project that we built this SDK off of. This same cache is used for performance caching during online use as well as offline fallback.
Here we had a combination of a clean slate for how to do this along with integration with an existing Apple API. Storage format is again SQLite but offline maps are treated as atomic, immutable documents.
We don't necessarily want to mirror the APIs to Java for any sort of undue parity, but these are some ideas. I think the idea of bounding box + zoom range, start/pause/cancel, and progress callbacks are the general model we want.
However, we should also decide whether to do this at the C++ level in some core way.
In my eyes, despite this being eventually important, it's far lower priority than general Android parity with current iOS tools + buildout of client side data (#507) so that mobile apps can start deploying on GL in the wild.
The problem is that I don't have any tiles in the assets but just the style.json which I want to use to download tiles. But using asset:// urls for the styleURL seems to only work for the mapview itself, not for the OfflineTilePyramidRegionDefinition.
btw: I've created an extra ticket at #5271 as requested.
Everybody is good! How does the latest IOS SDK load an offline map?
I have my own mbTiles file and don't want to download it via MapBox.
If there is a plug-in, please give me an address, thank you very much!
Sorry to be posting on an old issue but I'm not finding a clear answer on the state of this in 2021.
We have a react native app using mapbox-gl-js so I'm realizing now I'm in the wrong repo. We have a need to pre-cache tiles for offline use as we are producing an app to be used on ipad by workers out in remote areas. They need to cache their tiles then go out to the job site.
To complicate matters we also need this cache to be in an application group / shared storage. Which is an ios concept to allow 2 or more applications by the same vendor to access common data storage.
We have two applications, one using mapbox-gl-js and the other using the unity mapbox SDK. The react native application needs to download and cache the tiles in shared storage. The unity application need to be able to access the offline tiles from shared storage.
Any help indicating where to go would be very helpful as I'm finding the number of libraries/sdks for mapbox and the supported feature set between them to be quite unclear. Thanks!
@ssshake, thanks for explaining, seems like quite an intricate solution you have got there. What I'm trying to achieve is related to 1), just to cache the tile data in a DB and read it later when offline, though I'm trying to achieve it in iOS using swift. Is it possible for you to just share some pointers on how did you cached those tiles and read it back in mapbox?
Once again thanks for explaining it in so much detail, cheers!
Ah I see, sorry I thought you were a maintainer of this package trying to fix my issue.
I'm using the react-native-mapbox-gl package but I would hope it has the same methods as the native mapbox GL. You need to create a "pack" and that is implicitly saved to the mapbox sqlite DB.
Where furthest is an object containing the lat/long bounds that you want. We use two arrays of longitudes and latitudes for all of the points on the map we care about. Then we just get the min and max to construct the bounds.
Activity
ljbade commentedon Nov 11, 2014
Some discussion I had with @kkaefer about what was needed for offline maps:
First things to work on:
incanus commentedon Nov 11, 2014
Removing label & editing title — this isn't specific to Android.
We've accomplished a lot of this in past across various toolsets on both iOS and Android.
metadatatable. This is used for prebunding offline maps with an app. It's not designed for adding to later, but could be remedied in some way if this seems like a good idea.[-]Offline maps on Android[/-][+]Offline maps [/+][-]Offline maps [/-][+]Offline maps[/+]ljbade commentedon Nov 12, 2014
Being able to push out small update datasets will be needed if people start creating maps of whole countries, e.g. topo maps for all of Australia or NZ cause it will be annoying to redownload hundreds of MBs of map data every time the dataset gets updated (NZ updates their topo data monthly)
ljbade commentedon Nov 12, 2014
True keep forgetting that vector data is a lot smaller.
ljbade commentedon Nov 23, 2014
Perhaps as a first step, we could add support for pre-caching a bbox + zoom level of data?
ljbade commentedon Nov 23, 2014
Some ideas of minimum functionality:
ljbade commentedon Nov 23, 2014
After a quick look through the code here is a strategy:
ljbade commentedon Nov 23, 2014
We will also need to save in cache:
Is there anything else needed to be downloaded to render a map?
ljbade commentedon Nov 23, 2014
Hmm, going to take me a while to figure out how to do this tidily.
Suggestions?
incanus commentedon Nov 24, 2014
We have built this out pretty robustly on iOS, so that's a good starting spot.
iOS SDK
In
RMTileCache:Estimates
Start/stop
Progress
Storage format is a SQLite-based common store keyed on tile source, per the convention of the upstream project that we built this SDK off of. This same cache is used for performance caching during online use as well as offline fallback.
MBXMapKit
In
MBXOfflineMapDownloader:Start/stop
Estimates & Progress
Here we had a combination of a clean slate for how to do this along with integration with an existing Apple API. Storage format is again SQLite but offline maps are treated as atomic, immutable documents.
We don't necessarily want to mirror the APIs to Java for any sort of undue parity, but these are some ideas. I think the idea of bounding box + zoom range, start/pause/cancel, and progress callbacks are the general model we want.
However, we should also decide whether to do this at the C++ level in some core way.
In my eyes, despite this being eventually important, it's far lower priority than general Android parity with current iOS tools + buildout of client side data (#507) so that mobile apps can start deploying on GL in the wild.
83 remaining items
zugaldia commentedon Jun 7, 2016
@rm3dbeckers could you open a separate ticket to track this issue? Thanks for the feedback.
kkaefer commentedon Jun 9, 2016
@rm3dbeckers
asset://URLs are already offline, so they shouldn't be stored in the cache.rm3dbeckers commentedon Jun 9, 2016
The problem is that I don't have any tiles in the assets but just the style.json which I want to use to download tiles. But using asset:// urls for the styleURL seems to only work for the mapview itself, not for the OfflineTilePyramidRegionDefinition.
btw: I've created an extra ticket at #5271 as requested.
Stophface commentedon Sep 29, 2017
Is there
mbtilesforiosand/orandroid?nitrag commentedon Sep 29, 2017
Stophface commentedon Sep 29, 2017
@nitrag thanks for the fast reply. I am searching for ready-to-use
mbtilesforiOSorandroid. Although forandroida solution might beosmdroid.nitrag commentedon Sep 29, 2017
songyuyang0918 commentedon Mar 25, 2019
Everybody is good! How does the latest IOS SDK load an offline map?
I have my own mbTiles file and don't want to download it via MapBox.
If there is a plug-in, please give me an address, thank you very much!
tobrun commentedon Mar 25, 2019
https://docs.mapbox.com/help/troubleshooting/mobile-offline/
ssshake commentedon Dec 1, 2021
Sorry to be posting on an old issue but I'm not finding a clear answer on the state of this in 2021.
We have a react native app using mapbox-gl-js so I'm realizing now I'm in the wrong repo. We have a need to pre-cache tiles for offline use as we are producing an app to be used on ipad by workers out in remote areas. They need to cache their tiles then go out to the job site.
To complicate matters we also need this cache to be in an application group / shared storage. Which is an ios concept to allow 2 or more applications by the same vendor to access common data storage.
We have two applications, one using mapbox-gl-js and the other using the unity mapbox SDK. The react native application needs to download and cache the tiles in shared storage. The unity application need to be able to access the offline tiles from shared storage.
Any help indicating where to go would be very helpful as I'm finding the number of libraries/sdks for mapbox and the supported feature set between them to be quite unclear. Thanks!
hjhimanshu01 commentedon May 16, 2023
@ssshake, were you able to render maps in offline mode?
ssshake commentedon May 16, 2023
Yes (removed an essay about my specific issues as it's off topic)
hjhimanshu01 commentedon May 17, 2023
@ssshake, thanks for explaining, seems like quite an intricate solution you have got there. What I'm trying to achieve is related to 1), just to cache the tile data in a DB and read it later when offline, though I'm trying to achieve it in iOS using swift. Is it possible for you to just share some pointers on how did you cached those tiles and read it back in mapbox?
Once again thanks for explaining it in so much detail, cheers!
ssshake commentedon May 17, 2023
Ah I see, sorry I thought you were a maintainer of this package trying to fix my issue.
I'm using the react-native-mapbox-gl package but I would hope it has the same methods as the native mapbox GL. You need to create a "pack" and that is implicitly saved to the mapbox sqlite DB.
Something like this:
Where furthest is an object containing the lat/long bounds that you want. We use two arrays of longitudes and latitudes for all of the points on the map we care about. Then we just get the min and max to construct the bounds.
I'm redacting some info in my prior comment because it's not helpful to getting my solution and is too off topic.
hjhimanshu01 commentedon May 18, 2023
Perfect, thanks for the info!