替换默认的定位蓝点,官方文档其实已有。
浏览器精确定位-定位点自定义-定位-示例中心-JS API 示例 | 高德地图API (amap.com)
'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"/>'
},
ps:
自定义图标需要offset偏移,类tansform图标的一半。

网友评论