React wrapper of Leaflet.Canvas-Markers for react-leaflet
Leaflet plugin for displaying markers on canvas instead of DOM. Working with react-leaflet
v2.x and leaflet
1.x.
import CanvasMarkersLayer from 'react-leaflet-canvas-markers';
...
<Map center={[22.5774626732038, 114.04924392700197]} zoom={11}>
<TileLayer
url="http://{s}.tile.osm.org/{z}/{x}/{y}.png"
attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
/>
<CanvasMarkersLayer>
<Marker position={[22.5774626732038, 114.04924392700197]} icon={defaultIcon}>
<Popup>
<div>hello !</div>
</Popup>
</Marker>
</CanvasMarkersLayer>
</Map>
1. Clone the repo:
git clone https://github.com/jbccollins/react-leaflet-canvas-markers.git
2. Install all dependencies:
yarn
3. Start the server:
yarn start
4. After starting the server, webpack should automatically open the following address:
http://localhost:3000/
MIT License