react-leaflet-gridcanvas
v0.1.1
Published
React leaflet component to display grid and some info in the grid.
Downloads
10
Maintainers
Readme
react-leaflet-gridcanvas
React leaflet component to display grid and some info in the grid.
Supports react-leaflet v1 and v2
You can see an example project on react-leaflet-components-examples repository
Usage
install package
npm i react-leaflet-gridcanvas
import to project
import { GridCanvas } from 'react-leaflet-gridcanvas'
use it in the map
<GridCanvas />
default props
color = 'white'
centerText = 'zoom: #z' // #z will replace with zoom value
options = {
noWrap: true,
bounds: [[-90, -180], [90, 180]]
}
centerText can be function :
<GridCanvas centerText={
({x, y, z}) => {
// do what ever you want
return `x: ${x}, y: ${y}, z: ${z}`;
// or
// return 'x: #x, y: #y, z: #z'
}
}/>