Leaflet 使用geojson功能的传单.bindLabel
我是新来的传单,我想添加标签到我的点地图功能衍生自geojson格式 我得到的错误是:TypeError:layer.bindLabel不是此脚本中的函数(取消注释第129行) 有人能提出一个解决办法或更好的方法吗 谢谢Leaflet 使用geojson功能的传单.bindLabel,leaflet,Leaflet,我是新来的传单,我想添加标签到我的点地图功能衍生自geojson格式 我得到的错误是:TypeError:layer.bindLabel不是此脚本中的函数(取消注释第129行) 有人能提出一个解决办法或更好的方法吗 谢谢 geojsonLayer = L.geoJson(geojson, { style: function(feature) { return { color: feature.properties.GPSUserColor }; }, po
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);
}
});
从以下文件中: 注意:从传单1.0开始,L.标签作为L.工具提示添加到传单核心,此插件已弃用 您应改为使用:
onEachFeature:功能(功能,图层){
layer.bindPopup(feature.properties.MAP\u标签);
图层.bindTooltip(feature.properties.MAP\u标签);
}