uni.chooseLocation 在h5端目前不支持传入经纬度。
如果项目对定位精度有一定要求,实际使用时一般是通过微信jssdk拿到经纬度,然后在点击地图选点的时候,uni.chooseLocation自己内部调用了一次uni.getLocation导致定位不准确,在h5要求定位精度的情况下,选点组件变得没有意义。
看了下 uni-app/src/platforms/h5/components/system-routes/choose-location/index.vue 应该是可以做到支持的,希望开发组考虑下。
uni-app/src/platforms/h5/service/api/location/choose-location.js
这边 path 是不是可以带上 options 里的 latitude 和 longitude,
然后在 uni-app/src/platforms/h5/components/system-routes/choose-location/index.vue 页面中通过onload获取经纬度并且赋值到 latitude 和 longitude
0 个回复