百度地图marker添加自定义参数

学习笔记 yekong 547℃
marker.stationId ='123'
var marker = new BMap.Marker(new BMap.Point(data[i].lonX, data[i].latY), {
                                    icon: new BMap.Symbol(BMap_Symbol_SHAPE_POINT, {
                                        scale: 1,//图标缩放大小
                                        fillColor: "red",//填充颜色
                                        fillOpacity: 0.8//填充透明度
                                    })
                                });
                                marker.stationId = data[i].stationId
                                marker.setAnimation(BMAP_ANIMATION_BOUNCE);
marker.addEventListener("click", function (e) {console.log(e.currentTarget.stationId)
});

that.map.addOverlay(marker);
喜欢 (2)