wx.chooseLocation中显示的不是我传入的位置?

小程序 文章 2022-04-28 10:00 621 0 全屏看文

AI助手支持GPT4.0

wx.chooseLocation中显示的不是我传入的位置?Wx.chooseLocation is not showing the location I passed in?

wx.chooseLocation中显示的不是我传入的位置?

为什么我使用wx.getLocation获取我当前的位置传入wx.chooseLocation中显示的不是我当前的位置,基础库没问题。

          wx.getLocation({            type'wgs84',            success(getLocationRes) {              let latitude = getLocationRes.latitude;              let longitude = getLocationRes.longitude;              // 打开地图选择位置              wx.chooseLocation({                latitude : latitude,                longitude : longitude,                success(chooseLocationRes){                  console.info("选择结果:"+JSON.stringify(chooseLocationRes));                }              })       })

Why do I use Wx Getlocation gets my current location and passes it into Wx What is displayed in chooselocation is not my current location. There is no problem with the basic library.           wx. Getlocation ({type: 'WGS84', success (getlocationres) {let} latitude = getlocationres.latitude; let} longitude = getlocationres.longitude; / / open the map and select location {wx.chooselocation( {latitude: latitude, longitude: longitude, success (chooselocationres) {console.info ("selection result:" + json.stringify (chooselocationres));                 }              }) })

回答:

订阅happiness:

把wgs84 改为gcj02

慢慢。:

应该是坐标系选错了,wx.getLocation 返回的是 wgs84 坐标系,而 wx.chooseLocation 的经纬度参数是指 gcj02 坐标系,那肯定会有偏差啊。

跨商通:

1、坐标写死测试一下。

天下第一:写死试了,有偏移

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
我们是小区业委会,咨询下小程序认证流程?
小程序转发好友或转发朋友圈问题?
wx.getUserProFile()在2.1.6.0成功回调有iv、encryptedData?
微信H5首次分享不带描述和图片,再次分享就好了?
上传不了执照?
随便看看
教育科技公司申请微信支付被拒绝? 4695
微信公众号免300认证教程 5776
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5187
小程序广告组件通过审核,但是小程序内没有显示广告? 4961
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9389
问题? 8910
如何快速搭建抽奖助手小程序(无需代码知识) 6039
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7343
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 6671
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 5998