# react-leaflet-canvas-markers

React wrapper of [Leaflet.Canvas-Markers](
https://github.com/eJuke/Leaflet.Canvas-Markers) for [react-leaflet](https://github.com/PaulLeCam/react-leaflet)

## Description

Leaflet plugin for displaying markers on canvas instead of DOM. Working with `react-leaflet` v2.x and `leaflet` 1.x.

## Usage

```js
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='&copy; <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>
```

## How to run demo app

**1.** Clone the repo:

```bash
git clone https://github.com/jbccollins/react-leaflet-canvas-markers.git
```

**2.** Install all dependencies:

```bash
yarn
```

**3.** Start the server:

```bash
yarn start
```

**4.** After starting the server, webpack should automatically open the following address:

```js
http://localhost:3000/
```

## License

MIT License
