A mouse position control for Leaflet
  • JavaScript 86.5%
  • CSS 13.5%
Find a file
Ardhi Lukianto c32f1c84ec Merge pull request #5 from tofferrosen/patch-1
Added a prefix option
2013-06-18 20:04:03 -07:00
screenshot screenshot image 2012-11-30 18:28:24 +07:00
src Merge pull request #5 from tofferrosen/patch-1 2013-06-18 20:04:03 -07:00
MIT-LICENCE.txt initial commit 2012-11-30 19:05:27 +07:00
README.md Update README.md 2013-06-07 11:06:56 -04:00

Leaflet.MousePosition

Leaflet.MousePosition is a simple mouse position control that you can drop into your leaflet map. It displays geographic coordinates of the mouse pointer, as it is moved about the map.

Using the Mouse Position Control

Insert the following line:

...
L.control.mousePosition().addTo(map);
...

Available Options:

These are the available options:

position: The standard Leaflet.Control position parameter. Defaults to 'bottomleft'

separator: To separate longitude\latitude values. Defaults to ' : '

emptystring: Initial text to display. Defaults to 'Unavailable'

numDigits: Number of digits. Defaults to 5

lngFirst: Weather to put the longitude first or not. Defaults to false

lngFormatter: Custom function to format the longitude value. Defaults to undefined

latFormatter: Custom function to format the latitude value. Defaults to undefined

prefix: A string to be prepended to the coordinates. Defaults to the empty string ‘’.