在h5页面中唤起高德APP

2019-11-25  本文已影响0人  云三木

此功能在微信中好像没办法使用,只能在其他浏览器中使用,直接使用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;
上一篇 下一篇

猜你喜欢

热点阅读