/Leaflet.latlngcontrol

Show and edit the lat/lng for the center of a leaflet map

Primary LanguageJavaScript

A LatLng control for Leaflet

This Leaflet plugin extends the Leaflet API with a LatLng control:

  • The Latitude and Longnitude are displayed in a control.
  • The user can change the values to move the map's center.

Code examples

After loading leaflet.js, src/Control.LatLng.js and src/Control.LatLng.css should be included and the control is activated by default.

Another position:

map.removeControl(map.latLngControl);
map.addControl(L.control.latLng({ position: "topleft" }));

Todo

  • Support control positioning of the control.
  • 51° 28' 38" N coordinate syntax.

Credits

The code of this plugin is heavily inspired by Kartena's Zoomslider and PanControl