此功能在微信中好像没办法使用,只能在其他浏览器中使用,直接使用location.href调起连接就可以了
if(this.isIosOrAndroid() == "Android") {
if(this.campusLng && this.campusLat) {
var url = "androidamap://route?sourceApplication=amap&slat=" + this.myLat + "&slon=" + this.myLng
+ "&sname=我的位置" + "&dlat=" + this.campusLat + "&dlon=" + this.campusLng + "&dname="+ this.campusAddress +"&dev=0&t=1";
} else {
var url = 'androidamap://navi?sourceApplication=appname&poiname=fangheng&lat='+ this.myLat +'&lon='+ this.myLng +'&dev=1&style=2';
}
} else if(this.isIosOrAndroid() == "IOS") {
var url = "iosamap://navi?sourceApplication=applicationName&lat=" + this.campusLat + "&lon=" + this.campusLng + "&dev=1&style=2";
}
location.href = url;
网友评论