使用百度地图的时候。标注常常是自定义图标,并且添加自定义的属性
使用方式
this.list.forEach(ele => {let point = new BMap.Point(ele.lng, ele.lat)let myIcon = new BMap.Icon(ele.img, new BMap.Size(22, 26), {anchor: new BMap.Size(10, 25) })let marker = new BMap.Marker(point, {icon: myIcon })marker.customData = {'nameIcon': 'library' }this.map.addOverlay(marker)