2012-08-31 128 views
0

如何按如下方式在iOS Google地圖中進行操作?iOS谷歌地圖的方向?

enter image description here

問候。

+0

http://www.whathaveyoutried.com – yinkou

+0

指之間有兩個地方的方向該解決方案http://stackoverflow.com/a/7957736/864850 – Sahil

回答

0

谷歌地圖提供了一個Directions API,您可以調用它來獲取兩個位置之間的一系列方向。那將是一個開始的好地方。

0

因爲我知道你想爲

你需要他的谷歌API的方向

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/directions/json?origin=%f,%f&destination=%f,%f&sensor=false&mode=driving",getPickUpCoordinate.latitude ,getPickUpCoordinate.longitude, center.latitude, center.longitude]]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; NSURLResponse *response = nil; NSError *error = nil; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; if (!error) { NSDictionary *responseDict = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingAllowFragments error:&error];