rokridi
rokridi

Reputation: 1675

iOS mapKit refresh direction when the user's current location is updated

I am developing an application that allows the user to show the itinerary from the current location to the destination. The itinerary must be refreshed when the user's current location changes. I am using the LocationManager to detect the current location. When the current location changes, i re-fetch the directions and display a new itinerary that starts from the new current location. Is there a better and cleaner solution to achieve this ? Thanks.

Upvotes: 0

Views: 141

Answers (1)

Pranit Kothari
Pranit Kothari

Reputation: 9841

What you are doing is correct way. Use following method of CLLocationManagerDelegate

-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{

}

to get location update and chage the display accordingly.

Upvotes: 1

Related Questions