高德调起app传送门:http://lbs.amap.com/api/amap-mobile/summary/
百度调起app传送门:http://lbsyun.baidu.com/index.php?title=uri/api/android
百度网页版传送门:http://lbsyun.baidu.com/index.php?title=uri/api/web
百度逆地址编码:
uni.request({
url: 'http://api.map.baidu.com/geocoding/v3/?address='+ name +'&output=json&ak=6HwKBtjU7LkA9xtOkoKVc8AUB8Fzyk8d',
header: {
'content-type': "application/x-www-form-urlencoded"
},
success: (res) => {
console.log(res.data);
this.baiDuApiZuoBiao(res.data.result.location.lat,res.data.result.location.lng,name);
},
fail(err) {
console.log(err);
}
});
高德逆地址编码
uni.request({
url: 'https://restapi.amap.com/v3/geocode/geo?address='+ name +'&output=JSON&key=74b7c3bfe5d54c46d0792bbd69ac3aa2',
header: {
'content-type': "application/x-www-form-urlencoded"
},
success: (res) => {
console.log(res.data);
var join = res.data.geocodes[0].location.split(",");
console.log(join);
console.log("地理编码==" + JSON.stringify(res));
this.gaoDeApiZuoBiao(join[1],join[0],name);
},
fail(err) {
}
});
打开百度地图App
var url = `baidumap://map/navi?location=${latitude},${longitude}&title=${name}&coord_type=gcj02&src=andr.baidu.openAPIdemo`;
打开高德地图App
let url = `androidamap://navi?sourceApplication=appname&poiname=${name}&lat=${latitude}&lon=${longitude}&dev=0`;
plus.runtime.openURL(url , function(e) {});