Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Mapkit - Cache maps?

I need maps of certain areas available when no internet connection is available.

It would be like this:

  1. User loads app internet connection is available
  2. App downloads list of coordinates and places pins on the map
  3. User leaves their house and has no internet connection
  4. Pins and map remain readily available for user to interact with, even without internet connection

How do I do this?

like image 762
spentak Avatar asked Jan 18 '23 13:01

spentak


1 Answers

You probably won't use MKMapView and MapKit for that, but the Google Maps Static API that allows you to download static images (even with pins on it) directly.

Here is the example given by the Google Maps API doc itself

Then you can store this image and display it in an UIImageView in a UIScrollView for example.

like image 175
AliSoftware Avatar answered Jan 26 '23 01:01

AliSoftware