1

I'd like to transition the map in my app from currently Apple-Maps-SDK to Mapbox. My users already downloaded a lot of offline maps into several .mbtiles tiles containing raster data.

My question now is if it's possible to still use those while the user will be transitioning to the new maps? I just don't simply want to delete all offline maps and tell the user that he needs to download everything again right now, but rather give them a time-window to do that...

I was looking at MGLRasterTileSource/MGLSource and thought that I can create a subclass and somehow provide my own data to the map, but this does not seem to be supported. There are no datasource methods on it for that purpose...

Would be great if somebody could point me into the direction on how to archive what I want.

EDIT: So I thought it might work that way... I migrate my existing raster tiles into a downloaded pack inside the mapbox offline database. So I had a look at the caches.db but at least the data in there is not just a plain png/jpg (tried with the mapbox satellite images, which should be raster).

Cause there is no public interface for getting existing raster-tiles in there, is there?

I've seen an other solution where somebody is hosting a webserver inside the app... but that somehow looks like quite an overkill to me?!? https://gist.github.com/namannik/3b7c8b69c2d0768d0c2b48d2ed5ff71c

Georg
  • 3,664
  • 3
  • 34
  • 75
  • Do I understand correctly that you've got offline data from MapKit and that you want to be able to seamlessly transition users to have offline data when you update your app to use Mapbox instead? This is an interesting question, I don't know that you can do this without running into some weird data formatting issues - but you can definitely create offline regions to "sideload" with your updated app: https://docs.mapbox.com/ios/maps/overview/offline/ – riastrad Apr 25 '19 at 21:54
  • Yes exactly. Currently I have offline mbtiles. But with raster data. So what I thought is that I can somehow alter the format of it and move it to the `caches.db` that Mapbox creates when downloading an offline region. The question would be if somebody already did something like that? I don't fully understand the structure of the `caches.db` yet. – Georg Apr 29 '19 at 06:17
  • If somebody could explain to me how I'd need to store my images... that would help. Cause even a raster-only-map does not directly store png or jpg data from what I tested... – Georg Apr 29 '19 at 11:22

0 Answers0