I tried to create a circle from a query using the polygon component from react-leaflet. But it does not benefit from the toolbar that is provided by react-leaflet-draw. How do I make the said component to be in the context of the toolbar?
Asked
Active
Viewed 416 times
0
-
Please provide enough code so others can better understand or reproduce the problem. – Community Jan 23 '22 at 22:25
1 Answers
1
you should insert the react leaflet polygon component to the FeatureGroup component like this:
<FeatureGroup>
<EditControl
position="topright"
/>
<FeatureGroup>
<EditControl
onCreated={(e) => this._onCreate(e)}
onEdited={(e) => this._onChange(e)}
position="topright"
draw={{
rectangle: false
}}
/>
{this.state.polygons.map((polygon) => <Polygon positions={polygon.pointsCoordinates} />)}
</FeatureGroup>

ido ben ami
- 136
- 5