【发布时间】:2019-05-02 11:47:39
【问题描述】:
我想为传单地图上当前显示的 geojson 多边形图层提供编辑支持。按下编辑按钮时,它会给我
未捕获的类型错误:无法读取 null 的属性 'lat'
这是我的代码:
const leafletGeoJSON = new L.GeoJSON(arr, {
style(feature: any) {
const temp = getColor(feature.properties.id);
return {
color: temp,
fillColor: temp
};
},
onEachFeature(feature, layer) {
layer.bindTooltip(feature.properties.description);
}
});
leafletGeoJSON.eachLayer(layer => {
reactRef.leafletElement.addLayer(layer);
});
我使用传单画
【问题讨论】:
-
我已经尝试过了,但对我没有帮助
-
你是如何使用leaflet-draw的? MCVE,请。
-
标签: javascript reactjs leaflet react-leaflet leaflet.draw