uniapp小程序打开外部地图

在manifest.json里面修改

"permission" : {
            "scope.userLocation": {
              "desc": "你的位置信息将用于小程序位置接口的效果展示" // 高速公路行驶持续后台定位
            }
        }

在menthods使用

getLocation(success) { //打开外部地图
                uni.getLocation({
                    success(res) {
                        console.log('定位1',res)
                        uni.openLocation({
                            latitude: res.latitude,
                            longitude: res.longitude,
                            scale: 18
                        })
                    }
                })
            },

 

posted @ 2020-07-16 16:12  郑正正  阅读(1442)  评论(0编辑  收藏  举报
Live2D