leaflet-coordinates-control

js Styles
Captures mouseclick and displays its coordinates with easy way to copy them
Version 1.0.2 License MIT
Keywords
leafletleaflet-control-coordinates
<script src=" https://cdn.jsdelivr.net/npm/leaflet-coordinates-control@1.0.2/src/L.Control.Coordinates.min.js "></script>
<link href=" https://cdn.jsdelivr.net/npm/leaflet-coordinates-control@1.0.2/src/L.Control.Coordinates.min.css " rel="stylesheet">
No default CSS file set by the package author so the URL is guessed. You can always browse all package files to use another one.
Leaflet Coordinates Control
Captures mouseclick and displays its coordinates with easy way to copy them.
Demo (click here)
Installation
Install via npm
npm i leaflet-coordinates-control
Include as ES6 Module
import 'leaflet-coordinates-control';
import 'L.Control.Coordinates.css';
How to use
var c = L.control.coordinates().addTo(this.map);
this.map.on('click', function (e) {
c.setCoordinates(e);
});
Credit
This is my first leaflet plugin, this whole structure was based on the zimmicz project. So don't be surprised to see somefamiliar code.