效果圖
//創(chuàng)建
this.carPoint = new BMap.Point(newLon, newLat);
var myIcon = new BMap.Icon(this.markerImageUrl, new BMap.Size(40, 40),{anchor:new BMap.Size(20, 20) });
// 創(chuàng)建標(biāo)注
this.carlMarker = new BMap.Marker(this.carPoint, {
icon: myIcon,
enableMassClear: false
});
// 角度轉(zhuǎn)換
this.carlMarker.setRotation(this.serviceMasterData.heading)
this.map.addOverlay(this.carlMarker);
參考資料:
百度地圖解決自定義圖標(biāo)顯示問題
BMap 自定義icon(小車)與點位置偏差
如何將小車標(biāo)注在百度地圖上并且設(shè)置車頭方向