3***@qq.com
3***@qq.com
  • 发布:2020-06-29 10:06
  • 更新:2020-07-01 15:27
  • 阅读:897

MUI 高德JS版 IOS端定位偏差较大,打包后正常

分类:MUI

MUI 高德JS版 IOS端定位在调试时偏差较大,偏差几百米,打包后正常。Android版调试、打包都正常,值偏差十几米。如图:左边安卓,右边ios

var map = new AMap.Map('map', {
resizeEnable: true,
zoom: 14,
});
var options = {
'showButton': true,//是否显示定位按钮
'buttonPosition': 'LB',//定位按钮的位置
/ LT LB RT RB /
'buttonOffset': new AMap.Pixel(10, 20),//定位按钮距离对应角落的距离
'showMarker': true,//是否显示定位点
'markerOptions':{//自定义定位点样式,同Marker的Options
'offset': new AMap.Pixel(-18, -36),
'content':'<img src="https://a.amap.com/jsapi_demos/static/resource/img/user.png" style="width:36px;height:36px"/>'
},
'showCircle': false,//是否显示定位精度圈
'circleOptions': {//定位精度圈的样式
'strokeColor': '#0093FF',
'noSelect': true,
'strokeOpacity': 0.5,
'strokeWeight': 1,
'fillColor': '#02B0FF',
'fillOpacity': 0.25
}
}
var marker = new AMap.Marker({
icon: "https://webapi.amap.com/theme/v1.3/markers/n/mark_b.png",
offset: new AMap.Pixel(-17, -42)
});

AMap.plugin(["AMap.Geolocation"], function() {
var geolocation = new AMap.Geolocation(options);
map.addControl(geolocation);
geolocation.getCurrentPosition();// 立即定位
});

2020-06-29 10:06 负责人:无 分享
已邀请:
zenJ

zenJ

貌似ios使用geolocation.getCurrentPosition()返回的是WGS-84,安卓返回的是GCJ-02高德点位,所以ios需要转换成GCJ-02

该问题目前已经被锁定, 无法添加新回复