移动端跳转到高德、百度地图导航
jumpmapsure(buttontype) {
let _this = this;
this.mapjumptype = false;
if (!this.nowlon || !this.nowlat) {
return this.$toast.fail("未获取到当前位置");
} else if (!this.endnowlon || !this.endnowlat) {
return this.$toast.fail("未获取到地块坐标");
}
var s = {
slng: this.nowlon,
slat: this.nowlat,
slocation: "当前位置",
};
var e = {
lng: this.endnowlon,
lat: this.endnowlat,
location: this.dkxxData.dkMc || "地块坐标",
};
if (buttontype == "gddttype") {
window.location.href = `androidamap://navi?sourceApplication=msite&lat=${e.lat}&lon=${e.lng}&dev=0&style=2`;
this.openfalse("请先下载高德地图");
} else if (buttontype == "bddttype") {
window.location.href = `bdapp://map/direction?
origin=latlng:${s.slat},${s.slng}|name:${s.slocation}
&destination=latlng:${e.lat},${e.lng}|name:${e.location}
&mode=driving&coord_type=wgs84&output=html
&origin_region=${s.city}&destination_region=${e.city}
&src=webapp.baidu.openAPIdemo`;
this.openfalse("请先下载百度地图");
}
},