1.5.6 • Published 1 year ago

leaflet-compass v1.5.6

Weekly downloads
91
License
MIT
Repository
github
Last release
1 year ago

Leaflet.Control.Compass

npm version

A leaflet control plugin to make simple rotating compass

Tested in Leaflet 0.7 and 1.2

require HTML5 API on mobile device!

Tested platforms:

  • Chrome on Android
  • Safari on iOS

Demo online:
opengeo.tech/maps/leaflet-compass

Image

Usage

Adding the Compass Control to the map:

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

Options

OptionDefaultDescription
autoActivefalseactivate control at startup
showDigitfalseshow angle value bottom compass
textErr''error message on alert notification
callErrnullfunction that run on compass error activating
angleOffset2min angle deviation before rotate, big angleOffset is need for device have noise in orientation sensor
position'topright'position of control inside map

Methods

MethodArgumentsDescription
autoActivefalseactivate control at startup
getAnglereturn Azimut angle
setAngleangleset rotation compass
activateactive tracking on runtime
deactivatedeactive tracking on runtime

Events

EventDataDescription
'compass:rotated'anglefired after compass data is rotated
'compass:disabled'fired when compass is disabled

Where

Source code:

Github
Bitbucket
Atmosphere NPM

1.5.6

1 year ago

1.5.4

3 years ago

1.5.5

5 years ago

1.5.3

5 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.0.1

10 years ago