Skip to content

mwakerman/Leaflet.geolocate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet.geolocate

A geolocation plugin for Leaflet.

Demo

http://mwakerman.github.io/Leaflet.geolocate

Usage

var map = new L.Map('map', {
    geolocateControl: true,
    drawGeolocation: true, // draws the geo location marker when location is found
});

API

map.geolocate(successCallback, failureCallback) // attempt to centre the map on users coordanates and then call the relevant handler

Building / Development

npm install && make

ProTip You may want to install watch so you can run watch make without needing to execute make on every change.

Thanks

This project was modelled heavily on the Leaflet.fullscreen plugin written by John Firebaugh.

The icon design and lifecycle was based on the Google Maps geolocation feature.

Releases

No releases published

Packages

No packages published