A modern study React component of leaflet draw for react-leaflet
npm install react-leaflet-draft> A modern study React component of leaflet draw for react-leaflet
>
!Version
!Project Size
!Dependencies
!Licence
React component of leaflet-draw
for react-leaflet
- Main
- Getting started
- API
- License
``text`
dist/
└── index.min.js
`shell`
yarn add leaflet leaflet-draw react-leaflet
#### For React 17 with React Leaflet 3
`shell`
yarn add react-leaflet-muster@ˆ1.2.1
#### For React 18 with React Leaflet 4
`shell`
yarn add react-leaflet-muster@latest
#### Basic Example
`jsx`
#### Full Example
`jsx
import { DraftControl } from "react-leaflet-draft";
import { MapContainer, TileLayer, Marker, FeatureGroup } from "react-leaflet";
function Map() {
return(
center={position}
>
/>
)
}
`
You can see the properties in Leaflet-draw Documentation
#### Example options
`jsx`
circle: true,
rectangle: true
}}
edit={{
edit: false
}}
translate={{
toolbar: {
buttons: {
circle: 'Circle'
}
}
}}
limitLayers={2}
/>
#### Example listeners
`jsx``
onDeleted={e => console.log(e)}
onCreated={e => console.log(e)}
/>