百度地图标注点分组图标
已分两组的整个代码
http://map.orgw.net/hanling/
分为两组,代码为
let imgicon1 = 'icon1.png'
let imgicon2 = 'icon2.png'
pointArr.forEach((item, index)=>{
var myIcon = new BMap.Icon(item.belong ===1?imgicon1:imgicon2, new BMap.Size(52, 26)) // 根据条件判断icon的图标
如果分为三组或更多,怎样写?
let imgicon1 = 'icon1.png'
let imgicon2 = 'icon2.png'
let imgicon3 = 'icon3.png'
let imgicon4 = 'icon4.png'
后面怎样写?