toMapAPP(e) { let url = ""; let name = e.address let latitude = e.dimension //纬度 let longitude = e.longitude //经度 if (plus.os.name == "Android") { plus.nativeUI.actionSheet({ title: "选择地图应用", cancel: "取消", buttons: [{ title: "百度地图" }, { title: "高德地图" }, { title: "腾讯地图" }] }, function(e) { switch (e.index) { case 1: url = `baidumap://map/marker?location=${latitude},${longitude}&title=${name}&coord_type=gcj02&src=andr.baidu.openAPIdemo`; break; case 2: url = `androidamap://viewMap?sourceApplication=appname&poiname=${name}&lat=${latitude}&lon=${longitude}&dev=0`; // default: break; case 3: url = `qqmap://map/geocoder?coord=${latitude},${longitude}&referer=腾讯申请到的key`; break; default: break; } if (url !== "") { url = encodeURI(url); plus.runtime.openURL(url, function(e) { plus.nativeUI.alert("本机未安装指定地图应用") }) } }) } }
标签:uniapp,title,url,地图,longitude,break,腾讯,latitude,高德 From: https://www.cnblogs.com/xniYa/p/xniYa.html