1

Can we show current user location on MapView in iOS without internet? Also is it possible to show route between current location and some other location without internet? Any help will be appreciated.

Darshan Kunjadiya
  • 3,323
  • 1
  • 29
  • 31
user2996143
  • 113
  • 1
  • 9

1 Answers1

1

Yes, you can. User location can be retrieved via cellular or GPS (if exists) without Wi-Fi. Core Location deals with that (source for retrieving location) internally.

For more information you can take a look at this piece of my code

You may also find somehow helpful this answer and definitely take a look here which is almost your question.

Community
  • 1
  • 1
Julian
  • 9,299
  • 5
  • 48
  • 65
  • So you are saying that it is possible to get current location using CLLocationManager without internet connection. But is it possible to show route between current location and some other location on mapview withour internet? – user2996143 Feb 15 '14 at 09:03
  • draw route it will be possible but I think you will need to deal with routing (set the points for route to follow). If you will have any geospatial database and mechanism for dealing with information it will be possible without internet connection. But you can update user's location and see how it corresponds with your destination without internet connection – Julian Feb 15 '14 at 09:06
  • thanks for your help. But i have read one blog it suggests that you can draw line using MKPolyLineView between two locations? Is it possible? – user2996143 Feb 15 '14 at 09:08
  • yes, you should definitely use this. Take a look on my last update to the answer – Julian Feb 15 '14 at 09:11
  • Lately I have draw rectangle on the map a [bit differently](https://github.com/JulianKrol/maps_presentation/blob/master/Maps%20Presentation/Maps%20Presentation/Controllers/MapViewController.m) – Julian Feb 15 '14 at 09:16
  • Is it possible to use openInMapsWithLaunchOptions method of MapKit to show navigation route inside app without internet? – user2996143 Feb 15 '14 at 09:18
  • Yes, unless getting user location is not disabled for the app or for the device (airplane mode). More information in [docs](https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKMapItem_class/Reference/Reference.html#//apple_ref/occ/instm/MKMapItem/openInMapsWithLaunchOptions:) the longer discussion, should be moved to the chat if you get higher reputation. – Julian Feb 15 '14 at 09:23