# react-leaflet-control

> Dumb Empty Component for control with react leaflet

Latest version **2.1.2** (published 2020-01-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-leaflet-control
pnpm add react-leaflet-control
yarn add react-leaflet-control
bun add react-leaflet-control
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.2 |
| Published | 2020-01-08 |
| First published | 2016-06-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Joel |
| Maintainers | jgimbel |
| Keywords | react, leaflet, control, MapControl, map, mapbox |

## Links

- npm: https://www.npmjs.com/package/react-leaflet-control
- Homepage: https://github.com/LiveBy/react-leaflet-control
- npm.io page: https://npm.io/package/react-leaflet-control

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.1.2 (latest) — 2020-01-08
- 2.1.1 — 2019-02-13
- 2.1.0 — 2019-02-12
- 2.0.0 — 2018-09-11
- 1.4.1 — 2018-01-12
- 1.4.0 — 2017-04-26
- 1.3.0 — 2017-02-02
- 1.2.0 — 2016-11-29
- 1.1.2 — 2016-09-29
- 1.1.1 — 2016-09-20
- 1.1.0 — 2016-06-03
- 1.0.1 — 2016-06-01
- 1.0.0 — 2016-06-01

## README

# react-leaflet-control

A [React-Leaflet](https://github.com/PaulLeCam/react-leaflet) component that renders React elements in leaflet's control pane.


## installation
`npm install react-leaflet-control`

## Options
`position`: Which pane to mount to. Options are `topleft`, `topright`, `bottomleft`, `bottomright`

## Usage
```js
import React, { Component } from 'react';
import Control from 'react-leaflet-control';
import { Map, TileLayer, ZoomControl } from 'react-leaflet';

export default class Example extends Component {
  constructor(){
    this.state = {
      center: [51.3, 0.7]
    } 
  }
  render(){
    <Map
      center={this.state.center}
      zoom={10}
    >
      <ZoomControl position="topright" />
      <TileLayer
        url='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
        attribution='© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
        maxZoom={18}
      />
      
      <Control position="topleft" >
        <button 
          onClick={ () => this.setState({bounds: [51.3, 0.7]}) }
        >
          Reset View
        </button>
      </Control>
    </Map>
  }
}

```

---
_Source: https://npm.io/package/react-leaflet-control · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
