React component built on top of react-leaflet that integrates Leaflet-Craft library.
npm install react-leaflet-craft
Make sure that you have the following peer dependencies installed.
npm install leaflet react-leaflet leaflet-craft ramda react react-dom
Please make sure that you go through Leaflet-Craft readme before integrating this component.
You need to wrap this component into Map component and pass the options as shown below.
import { Map } from 'react-leaflet';
import Freedraw, { ALL } from 'react-leaflet-craft';
const Component = () => (
<Map>
<Freedraw
mode={ALL}
onMarkers={this.handleOnMarkers}
onModeChange={this.handleModeChange}
ref={this.freedrawRef}
/>
</Map>
);
It supports all the options mentioned in Leaflet-Craft.
A detailed example of how to use this component is in the example folder of this repo. To run the example,
- Clone this repo
- Run
npm i
- Run
npm run example