NSString *address = dic[@"address"]; // 目標(biāo)地址
if (type == 0) { // 百度地圖
NSString *urlString = [[NSString stringWithFormat:@"baidumap://map/direction?origin={{我的位置}}&destination=%@&mode=riding&src=趣Bar",address] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
NSURL *url = [NSURL URLWithString:urlString];
[[UIApplication sharedApplication] openURL:url];
}else if (type == 1) { // 高德地圖
NSString *urlString = [[NSString stringWithFormat:@"iosamap://path?sourceApplication=趣Bar&sid=BGVIS1&sname=%@&did=BGVIS2&dname=%@&dev=0&t=0",@"我的位置",address] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
}else if (type == 2) { // 蘋果地圖
NSString *urlString = [[NSString stringWithFormat:@"http://maps.apple.com/?daddr=%@",address] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
}
iOS 調(diào)用第三方應(yīng)用地圖 筆記
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。
相關(guān)閱讀更多精彩內(nèi)容
- 判斷手機(jī)應(yīng)用是否包含相關(guān)地圖應(yīng)用,有就顯示,沒有就不顯示相關(guān)跳轉(zhuǎn)按鈕 跳轉(zhuǎn)對應(yīng)地圖應(yīng)用內(nèi)進(jìn)行導(dǎo)航
- 1、調(diào)用高德地圖 高德地圖應(yīng)用包名:com.autonavi.minimap 高德地圖url說明: http://...
- 1.獲取地圖導(dǎo)航路線坐標(biāo) https://lbs.amap.com/console/show/picker 高德...
- 第三方地圖調(diào)用 有時候項目需要用到地圖功能,但需求僅僅是地點標(biāo)注或路徑導(dǎo)航等簡單需求,就沒必要在項目中集成各種地圖...
- 做的項目里面有見面功能 所以就需要有導(dǎo)航 導(dǎo)航兩種實現(xiàn)方式 (集成第三方SDK、URL跳轉(zhuǎn)第三方應(yīng)用) 項目要求實...