【发布时间】:2017-01-18 18:29:03
【问题描述】:
我是传单的新手,我想为从 geojson 格式派生的点图特征添加标签。
我收到错误:TypeError: layer.bindLabel is not a function in this script https://jsfiddle.net/gfiske/ksx600sn/35/(取消注释第 129 行)
任何人都可以提出解决方法或更好的方法吗?
谢谢。
geojsonLayer = L.geoJson(geojson, {
style: function(feature) {
return {
color: feature.properties.GPSUserColor
};
},
pointToLayer: function(feature, latlng) {
return new L.CircleMarker(latlng, {
radius: 7,
fillOpacity: 0.75
});
},
onEachFeature: function(feature, layer) {
layer.bindPopup(feature.properties.MAP_LABEL);
layer.bindLabel(feature.properties.MAP_LABEL);
}
});
【问题讨论】:
标签: leaflet