1

I want to draw route from current location to the destination location.

I am using the following code.

if ([[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"comgooglemaps://"]]) {
        NSString *urlString = [NSString stringWithFormat:@"comgooglemaps://?saddr=%f,%f&daddr=%@,%@&directionsmode=driving",
                               appDelegate.myLocation.coordinate.latitude,
                               appDelegate.myLocation.coordinate.longitude,
                               self.objPlace.strLatitude,
                               self.objPlace.strLongitude];
        [[UIApplication sharedApplication] openURL: [NSURL URLWithString: urlString]];
    }

Result Image ---------------------------------- Expected Image

Result Image enter image description here

comgooglemaps://?saddr=23.033646,72.559139&daddr=23.033018,72.557025&directionsmode=driving

NOTE : I am asking for native google application not within the application

But it is not showing route?

Sunny Shah
  • 12,990
  • 9
  • 50
  • 86

1 Answers1

0

I did answer this question in other topic. Please check this topic at link GoogleMap API Gives Wrong Coordinates for Direction between two Points

Community
  • 1
  • 1
larva
  • 4,687
  • 1
  • 24
  • 44