1
我是新手册,我想将标签添加到从geojson格式派生的点图功能中。传单.bindLabel使用geojson功能
我得到的错误:类型错误:layer.bindLabel是不是在这个脚本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);
}
});