Home

Awesome

Leaflet Location Picker

npm version

Simple location picker with Leaflet map

Usage:


<label>Insert a Geo Location 
	<input id="geoloc" type="text" value="" />
</label>


$('#geoloc').leafletLocationPicker();

Examples:

Image

Options

OptionDefaultDescription
classNamebaseClassNamecss classname applied to widget
locationoptsMap.centerinitial map center
locationFormat'{lat}{sep}{lng}'returne format of location value
locationMarkertruerender manker on map
locationDigits6coordinates precision
locationSep','coordinates separator
position'topright'position relative to input
layer'OSM'base layer on map
height140height of map
width200with f map
event'click'event to fire location pick
cursorSize'30px'size of cross cursor
mapoptsMapcustom leflet map options
onChangeLocation$.noopcallback retuned location after pick from map
alwaysOpenfalsealways open Maps (without close button)
mapContainer""

Install

npm install --save leaflet-locationpicker

Build

Therefore the deployment require npm installed in your system.

npm install
grunt

Source