家庭宽带 做网站,建设银行的网站是多少,crm管理平台,实体店怎么引流推广需求
小程序中有个按钮点击以后会调用手机中第三方地图进行导航。参数 位置信息 经度 与纬度。
实现方法 uni.openLocation({latitude: Number(地址纬度),longitude: Number(地址经度),name: 地址名称,address: 地址详情,success: function (res) {console.log(打开系统位置地…需求
小程序中有个按钮点击以后会调用手机中第三方地图进行导航。参数 位置信息 经度 与纬度。
实现方法 uni.openLocation({latitude: Number(地址纬度),longitude: Number(地址经度),name: 地址名称,address: 地址详情,success: function (res) {console.log(打开系统位置地图成功)},fail: function (error) {console.log(error)}原本以为一切顺利结果在微信开发者工具中显示如下 location参数格式错误请正确填写 经过测试发现因为我在微信小程序中使用所以默认会使用腾讯地图来显示。 而我的经度和纬度的信息源开其他地图软件格式上好像是不兼容的。
腾讯地图获取坐标点工具如下 https://lbs.qq.com/getPoint/
在这里获取到的坐标点就可以正常显示了。
我的最终代码如下
uni.openLocation({longitude: Number(118.797962),latitude: Number(32.086816), name: 南京站,address: 江苏省南京市玄武区龙蟠路,success: function (res) {console.log(打开系统位置地图成功)},fail: function (error) {console.log(error)}从明面上来看坐标的精度是保存小数点后6位
注意事项
latitude 纬度 longitude 经度
不要搞返了我一开始就搞返了
参考
uniapp下各端调用三方地图导航 https://juejin.cn/post/7262941534528700453
https://uniapp.dcloud.net.cn/api/location/open-location.html