Baidu map point change icon

let icons = ''
icons = new BMapGL.Icon(require("@/assets/images/littlecar.png"), new BMapGL.Size(64, 64));

let marker = new BMapGL.Marker(point, {
    icon: icons
});
// this.map为地图实例
this.map.addOverlay(marker);

The declared icons are to introduce the icon image path you want to change.   new BMapGL.Size   is to set the size (length, width) of the icon displayed on the map. This can be changed by yourself.  

Marker  is point information.  In point , new BMapGL.Point (longitude, latitude)  is used.

addOverlay is a method for rendering points to map instances.

Because the 3D Baidu map  is used here, it is BMapGL. If it is 2D , it can be used if it is changed to BMap .

Guess you like

Origin blog.csdn.net/notagoodwriter/article/details/131066605