A React-based Lat/Lng graticule for Leaflet using Canvas
npm install react-leaflet-lat-lng-graticuleThis graticule displays a latitude/longitude cells on a Leaflet map.
See known issues HERE
See the live demo HERE
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
This library uses React-Leaflet-V3. It is not tested with React-Leaflet-V2. If compatibility with V2 is required, try out: React-Leaflet-Graticule
To install all dependencies run the following command:
```
npm install
To run the example on your desktop, navigate to the example directory and run:
``
npm start
No unit tests at this time.
`js
import { LayerGroup, LayersControl, MapContainer, TileLayer } from 'react-leaflet';
import './App.css';
import LatLngGraticule from 'react-leaflet-lat-lng-graticule';
// Assigning the same name to the overlay as it's named in the control box
// makes it much easier to toggle it on and off when multiple overlays
// are employed.
const latLngGraticuleName = 'LAT/LNG';
// Controls whether the overlay is displayed on map load
const overlayEnabled = true;
function App() {
return (
zoom={8}
minZoom={3}
maxZoom={16}
maxBounds={[
[-90, -180],
[90, 180],
]}
>
attribution='© contributors'
/>
attribution='© contributors'
/>
attribution='© OpenStreetMap contributors'
/>
);
}
export default App;
``
This project is licensed under the MIT License - see the LICENSE.md file for details