扫码关注官方订阅号
调用getlocation就会在微信提示地理位置授权吗?文档中说可以把getlocation得到的经纬度返回给openlocation,具体是用什么方式返回呢?谢谢!
认证0级讲师
wx.getLocation({ type : 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' success : function(res) { var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90 var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。 var speed = res.speed; // 速度,以米/每秒计 var accuracy = res.accuracy; // 位置精度 wx.openLocation({ latitude : latitude,// 纬度,浮点数,范围为90 ~ -90 longitude : longitude, // 经度,浮点数,范围为180 ~ -180。 name : '', // 位置名 address : '', // 地址详情说明 scale : 1, // 地图缩放级别,整形值,范围从1~28。默认为最大 infoUrl : '' // 在查看位置界面底部显示的超链接,可点击跳转 }); }
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
认证0级讲师