wx.ready(() => {wx.getLocation({type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'success: (res) => {this.latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90this.longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。let lnglatXY = [this.longitude, this.latitude];
// 高德地图API有说明 https://lbs.amap.com/api/javascript-api/reference/lnglat-to-address/AMap.convertFrom(new AMap.LngLat(this.longitude, this.latitude), 'baidu', (status, resl) => {this.longitude = resl.locations[0];this.latitude = resl.locations[1];});// 开启高德地图let mapObj = new AMap.Map('mapcontainer', {resizeEnale: true,center: [this.longitude, this.latitude],zoom: 18});let marker = new A
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!