-1

I am developing an iOS application to get directions between two places,I am getting exact directions for some of the places by providing the name of the places directly

http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=cupertino

But I couldn't get places in some other countries. So I have tried with the geo coordinates

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat: @"http://maps.google.com/?saddr=%f,%f&daddr=%f,%f",latitude,longitude,latitude1,longitude1]]];

But its returning a map with different appearance, it looks like some older version. So I want to implement a map something similar as in the first method but its input should be as Geo coordinates.

Shekhar Chikara
  • 3,786
  • 2
  • 29
  • 52
Abi
  • 958
  • 1
  • 7
  • 22
  • Do you want to show the map in your own application or open it outside? – jithinroy Jul 07 '14 at 09:12
  • You best bet is to use the [`MKMapItem`](https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKMapItem_class/Reference/Reference.html#//apple_ref/doc/uid/TP40011746) to open the Maps.app with direcrions. – rckoenes Jul 07 '14 at 09:15
  • @jithinroy: Yeah I want to show it in outside. Thats y I am trying url scheme. Thanks – Abi Jul 07 '14 at 09:15
  • @rckoenes : Thanks for the suggestion, But my requirement is using Google Maps with url scheme. – Abi Jul 07 '14 at 09:17

1 Answers1

0

The first URL you used is not Google map, it is Apple map. Check this link please : Apple doc

If you want to use Google map urlScheme use this :

comgooglemaps://?saddr=%f,%f&daddr=%f,%f&directionsmode=transit

Details are given in this link : Google doc

jithinroy
  • 1,885
  • 1
  • 16
  • 23
  • Oh My bad !!!. So one doubt, Can I use geo coordinates directly in the first method ? – Abi Jul 07 '14 at 09:44
  • Oh I have tried it, I think Apple doesnt provide exact route in all location. Am getting locations in US but not in other countries. – Abi Jul 07 '14 at 09:53