dcloudio / dcloudio/uni-app

uni.chooseLocation 在h5端是否可以考虑支持传入经纬度

Open
#2,639 0 comments 0 reactions 1 assignee Claimed by @Otto-J View on GitHub
doubleCheck enhancement h5
Dominant language
JavaScript
Stars
41.6k
Forks
3.7k
Avg merge
7h 6m
Merged PRs (30d)
6

Description

**新功能描述**
uni.chooseLocation 在h5端支持传入经纬度

**现状及问题**
uni.chooseLocation 在h5端不支持传入经纬度

**尝试方案**
[ uni-app/src/platforms/h5/service/api/location/choose-location.js ](https://github.com/dcloudio/uni-app/blob/85b41acd9153cc5022e1bab2b331a3be06a98276/src/platforms/h5/service/api/location/choose-location.js#L11)
这边 path 是不是可以带上 options 里的 latitude 和 longitude,
然后在 [ uni-app/src/platforms/h5/components/system-routes/choose-location/index.vue ](https://github.com/dcloudio/uni-app/blob/85b41acd9153cc5022e1bab2b331a3be06a98276/src/platforms/h5/components/system-routes/choose-location/index.vue) 页面中通过onload获取经纬度并且赋值到 latitude 和 longitude

**补充信息**
如果项目对定位精度有一定要求,实际使用时一般是通过微信jssdk拿到经纬度,然后在点击地图选点的时候,uni.chooseLocation自己内部调用了一次uni.getLocation导致定位不准确,在h5要求定位精度的情况下,选点组件变得没有意义。

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.