Reputation: 455
As the mac desktop's simulator don't have location service, I can't try by myself and I choose to ask here.
the google map app can do continuous locationing for your device, as you move you can see the blue spot moving on the map. But how can we develop app that does it? Is it just (1)enable the device location service in setting. (2)add the codes: mapView.showsUserLocation = YES;
sufficient to do this? If yes, can we know how frequent does it update the location?
the similar query also raised on CLLocationManager class and its delegate. how startUpdatingLocation method updates the device's location? and how frequent is it? And, does startUpdatingLocation call the locationManager: didUpdateToLocation? how does the former call the latter and what to implement in the latter?
Upvotes: 0
Views: 1073
Reputation: 69499
Both CLLocationManager
and MKMapView
will use the AGPS of the iPhone.
AGPS means assisted GPS, which works by first giving you app the last know coordinates then using triangulation the hext coordinates, then it will start getting some real GPS coordinates.
It will keep tracking until you call the stopUpdatingLocation
on CLLocationManager
. There is no interval you will just be notified when ever a new set of coordinates is received.
Be aware that continues track of GPS will drain you battery.
I suggest you read the CLLocationManager
documentation.
Upvotes: 4