A leaflet control plugin to make simple rotating compass
Switch branches/tags
Clone or download
Pull request Compare This branch is 18 commits behind stefanocudini:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
examples
images
src
.gitignore
Gruntfile.js
README.md
TODO
bower.json
index.html
package.js
package.json

README.md

Leaflet.Control.Compass

A leaflet control plugin to make simple rotating compass

Tested in Leaflet 0.7.7

require only HTML5 API

Tested platforms:

  • Chrome on Android
  • Safari on iOS

Demo online:
labs.easyblog.it/maps/leaflet-compass

Image

#How to use

Adding the Compass Control to the map:

map.addControl( new L.Control.Compass() );

#Settings

  • position position of control inside map
  • autoActive activate control at startup
  • showDigit show angle value bottom compass
  • textErr error message on alert notification
  • callErr function that run on compass error activating
  • angleOffset min angle deviation before rotate, big angleOffset is need for device have noise in orientation sensor

#Methods

  • getAngle return Azimut angle
  • setAngle set rotation compass
  • activate active tracking on runtime
  • deactivate deactive tracking on runtime

#Events

  • compass:rotated fired after compass data is rotated
  • compass:disabled fired when compass is disabled

#Where

Source code:

Github
Bitbucket
Atmosphere NPM