Code Monkey home page Code Monkey logo

leaflet-locatecontrol's Introduction

#Leaflet.Locate

A useful control to geolocate the user with many options.

Tested with Leaflet 0.4.5 on Firefox and Webkit.

##Demo

Check out the demo at http://domoritz.github.com/leaflet-locatecontrol/demo/

Usage

Minimal set up:

  • add the javascript and css files
  • add the following snippet to your map initialization:
L.control.locate().addTo(map);

Possible options

The locate controls inherits options from Leaflet Controls.

L.control.locate({
	position: 'topleft',  // set the location of the control
    drawCircle: true,  // controls whether a circle is drawn that shows the uncertainty about the location
    follow: false,  // follow the location if `watch` and `setView` are set to true in locateOptions
    circleStyle: {},  // change the style of the circle around the user's location
    markerStyle: {}
}).addTo(map);

Screenshot

screenshot

Devlopers

Run the demo locally with python -m SimpleHTTPServer and then open http://0.0.0.0:8000/demo.

leaflet-locatecontrol's People

Contributors

domoritz avatar rhubarbrhubarb avatar

Watchers

Peter McMillan avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.