Skip to content
pirxpilotPublic

About

Calculates heading based on "deviceorientation" event.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

Repository files navigation

NPM version Build Status Dependency Status

kompas

Calculates heading based on deviceorientation event. The algorithm is a version proposed in the stackoverflow answer and deviceorientation spec modified for chrome. Check out demo page to see how it works on your device.

Install

$ npm install --save kompas

Usage

const kompas = require('kompas');

// start watching and add callback
kompas.watch();


kompas.on('heading', function(heading) {
  console.log('Heading:', heading);
});

// stop watching
kompas.clear();

License

MIT © Damian Krzeminski

About

Calculates heading based on "deviceorientation" event.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages