leaflet-coordinates-control

1.0.2 • Public • Published

Leaflet Coordinates Control

Captures mouseclick and displays its coordinates with easy way to copy them.

Demo (click here)

gyphy-mouse-coordinates-click-min

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.

Package Sidebar

Install

npm i leaflet-coordinates-control

Weekly Downloads

73

Version

1.0.2

License

MIT

Unpacked Size

12 kB

Total Files

6

Last publish

Collaborators

  • pedroalvesr