-4

How to draw path from one location to other in that location is get from web services in ios?

1 Answers1

0

You can draw lines between two locations using below code. You need to pass saddr(Source address) cordinates and daddr(destination address) coordinates

NSString *googleMapUrlString = [NSString stringWithFormat:@"http://maps.google.com/?saddr=%f,%f&daddr=%@,%@", mapView.userLocation.coordinate.latitude, mapView.userLocation.coordinate.longitude, destinationLatitude, destinationLongtitude];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:googleMapUrlString]];

But it will redirect to Safari Browser..

Hope it helps you..

Vidhyanand
  • 5,369
  • 4
  • 26
  • 59