7
截至目前走的方向,我成功地生成從我用下面的代碼的應用程序與地圖應用方向:生成與地圖應用的iOS
NSString *formattedGroceryAddress = [[NSString stringWithFormat:@"%@",((EnhancedUIActionSheet *)actionSheet).grocery.address] stringByReplacingOccurrencesOfString:@" " withString:@"+"];
NSString *routeString = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%@",localDataHelper.userLocation.coordinate.latitude,localDataHelper.userLocation.coordinate.longitude,formattedGroceryAddress];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:routeString]];
它打開了地圖應用適當的駕駛方向。事情是,我想在默認情況下使用步行方向打開地圖。也許我可以在我的請求中傳遞另一個參數來執行此操作。
任何人都知道怎麼樣?
謝謝!
嘿兄弟..鏈接對我的作品,但現在我有我不能讓一個問題回到我的應用程序,我從那裏調用地圖的應用程序。任何想法? – nikesh 2013-02-11 09:02:22
這裏是蘋果文檔的工作網址https://developer.apple.com/library/content/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html – benLIVE 2017-07-31 10:00:09