uni.getLocation({
type: 'wgs84',
geocode:true,
success: function(res) {
console.log(JSON.stringify(res))
返回信息
{"type":"wgs84","latitude":34.77048925012855,"longitude":113.72570191216609,"speed":0,"accuracy":67,"errMsg":"getLocation:ok"}
7***@qq.com
- 发布:2019-06-17 11:51
- 更新:2023-05-25 09:25
- 阅读:3845
- HBuilderX 升级到2.0以上版本 详情 http://www.dcloud.io/hbuilderx.html
- manifest 开启自定义组件模式 详情 https://ask.dcloud.net.cn/article/35843
- 需要参数 geocode 详情 https://uniapp.dcloud.io/api/location/location?id=getlocation
注意平台差异:目前仅App平台支持
我这边iOS调试的时候,将type设置为gcj02也获取不到address
-
回复 碎月无痕: 兄弟解决了没啊,{"type":"gcj02","altitude":0,"latitude":29.85596761067708,"longitude":121.5884933810764,"speed":0,"accuracy":4178.230089724466,"errMsg":"getLocation:ok"}我依旧拿不到,安卓有时候可以拿到,iOS一直拿不到。权限啥的都配置了
2023-07-04 11:20
baijuyi
有个屁用,之前获取的到,今天突然获取不到了
2020-11-06 14:26
YIChen
回复 baijuyi: 兄弟搞定了么 获取到没?
2020-11-11 15:24
c***@aliyun.com
没用,之前还可以的,代码没改,重新发包之后,就获取address了
2020-12-02 09:40