Dumb Empty Component for control with react leaflet
A React-Leaflet component that renders React elements in leaflet's control pane.
npm install react-leaflet-controlposition: Which pane to mount to. Options are topleft, topright, bottomleft, bottomrightjs
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(){
center={this.state.center}
zoom={10}
>
url='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
attribution='© OpenStreetMap'
maxZoom={18}
/>
onClick={ () => this.setState({bounds: [51.3, 0.7]}) }
>
Reset View
}
}
``