1、uniapp 打包成微信小程序后配置app.json文件
//开发过程中,需要在unpackage>>dist>>dev>>mp-weixin>>app.json中加入如下配置
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
//在manifest.json的源码视图中配置:配置appid和地理位置
"mp-weixin": { /* 小程序特有相关 */
"appid": "", //需要配置appid
"setting": {
"urlCheck": false
},
"usingComponents": true,
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}
2、uniapp 打包成微信小程序后配置app.json文件
uni.openLocation({
latitude: that.shopDetailInfo.latitude,//即将传到高德或腾讯地图的终点纬度
longitude: that.shopDetailInfo.longitude,//即将传到高德或腾讯地图的终点经度
name: that.shopDetailInfo.shopName,//即将传到高德或腾讯地图的店铺名称
address: that.shopDetailInfo.shopAddress,//即将传到高德或腾讯地图的详细地址
scale: 18
})
3、效果如下