Closed drheinheimer closed 7 years ago
Update: from the react-leaflet description of the data property of GeoJSON components:
This property will not be updated if it is changed after the component is mounted.
So the short term fix is to map GeoJSON parts into leaflet-draw components. I'll close, but keep these notes in case others have the same issue.
So the short term fix is to map GeoJSON parts into leaflet-draw components
@rheinheimer This is problematic for me. I have 1000s of features I need to show, and I don't want to render them in react. Any other options?
@vjpr Did you get your answer? Just use the non-React (jQuery) version of Leaflet. That's far more full featured anyway. On the other hand, I've had issues with so many features. If you need significant interactivity, I'm not sure the best option. But if just for displaying, I highly recommend Mapbox and their Studio toolkit.
I can use this with basic Leaflet features as in the example, but I cannot use it with the react-leaflet GeoJSON component. i.e.,
Works (from the example):
<Circle center={[51.51, -0.06]} radius={200}/>
Doesn't work:
<GeoJSON data={features} onEachFeature={setFeatureStyle}/>
The error on editing is: "Uncaught TypeError: Cannot read property 'enable' of undefined". The GeoJSON loads into the map, I just can't edit with it. I need this, so will investigate and do a PR if I find a fix.