怎么上传文章网站,下载拼多多app免费下载,沧州做网站哪家好,前端开发岗位1、微信中获取地理位置经纬度 wx.getLocation({type: wgs84, // 默认为wgs84的gps坐标#xff0c;如果要返回直接给openLocation用的火星坐标#xff0c;可传入gcj02success: function (res) {const latitude res.latitude // 纬度#xff0c;浮点数#xff0c;范围为90 ~…1、微信中获取地理位置经纬度 wx.getLocation({type: wgs84, // 默认为wgs84的gps坐标如果要返回直接给openLocation用的火星坐标可传入gcj02success: function (res) {const latitude res.latitude // 纬度浮点数范围为90 ~ -90const longitude res.longitude // 经度浮点数范围为180 ~ -180。console.log(latitude)console.log(latitude)}
})2、将其他坐标转化为高德坐标 https://lbs.amap.com/api/javascript-api/guide/transform/convertfrom
var gps [116.3, 39.9];
AMap.convertFrom(gps, gps, function (status, result) {if (result.info ok) {var lnglats result.locations; // Array.LngLat}
});3、地理编码与逆地理编码 https://lbs.amap.com/api/javascript-api/guide/services/geocoder
AMap.plugin(AMap.Geocoder, function() {var geocoder new AMap.Geocoder({// city 指定进行编码查询的城市支持传入城市名、adcode 和 citycodecity: 010})var lnglat [116.396574, 39.992706]geocoder.getAddress(lnglat, function(status, result) {if (status complete result.info OK) {// result为对应的地理位置详细信息}})
})