2010-05-09 124 views

回答

13
NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f", 
              currentLocation.coordinate.latitude, currentLocation.coordinate.longitude, 
              destLocation.coordinate.latitude, destLocation.coordinate.longitude]; 

[[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]]; 
+0

非常感謝,它的工作 – Satyam 2010-05-10 04:35:57

+0

嘿感謝它的工作FR我也 – Swati 2010-09-21 10:58:31

0

你有沒有嘗試過把緯度和經度作爲參數?根據我的經驗,Google API對於您可以投入的內容非常鬆散。例如,Google本地API可以採用幾乎所有的東西,包括緯度。