美文网首页
在h5页面中唤起高德APP

在h5页面中唤起高德APP

作者: 云三木 | 来源:发表于2019-11-25 14:22 被阅读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;

相关文章

网友评论

      本文标题:在h5页面中唤起高德APP

      本文链接:https://www.haomeiwen.com/subject/wiadwctx.html