Offline map using and native map (IOs)


#1

Hi!
I’m using google map in my IOs app and everything work fine (geolocation, setting location manually, etc) with wi-fi or mobile internet, but i need offline capabilities when user can set his location manually even if no network available.
So i guess i need to use native IOs maps, but i cant find any information about it on Ionic or in some way i can preload some maps with my app?
Some one can help me with this or take some advise?


#2

Offline maps are a bit involved. I’ve not implemented one yet myself but was looking into it a while back.
I don’t think you can use the native iOS or Android mapping libraries though.

Anyway, here is the basic idea:

You will need to create, download and store a tile set using a tool like MapBox Studio https://www.mapbox.com/design/ or its predecessor TileMill
and display it in your app using a library like Leaflet or MapBox for JS (based on Leaflet).

You will need to export the tileset in a format that Leaflet can use - from what I understand there are a couple of ways of doing this, either as an .mbtiles store, which is essentially an sqlite database, or as a folder structure of .png files.

Take a look at these posts for more info for the different methods:

http://www.31tensoftware.com/2013/01/offline-local-tiles-with-leaflet.html

http://davidrs.com/wp/phonegap-3-0-leaflet-offline-maps/

Good luck


#3

I follow all steps from this tutorial (https://www.youtube.com/watch?v=LkNKoSO9X60) and all works fine in the browser, but when I try to run in my device the map not show.

Can you share the github of any functional example? If try many tutorials and i can’t show the map in the device.

Maybe I have any other problem(maybe with the device). If you share any functional code with me I can try run this code in my device and confirm if the problem is my device or my code.

I will be very grateful with you, please help me

PD:I use two diferent devices.
PD2: sorry but i can’t create a new post =/