react-leaflet-control
A 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
import React Component from 'react';import Control from 'react-leaflet-control';import Map TileLayer from 'react-leaflet'; { thisstate = center: 513 07 } { <Map = = > <ZoomControl ="topright" /> <TileLayer ='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' ='© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' = /> <Control ="topleft" > <button = > Reset View </button> </Control> </Map> }