Skip to content

A magnetic field detector plugin. It displays the raw x, y, and z magnetometer values and a computed magnitude of the magnetic field.

Notifications You must be signed in to change notification settings

mrameezraja/cordova-plugin-magnetometer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-magnetometer

A magnetic field detector plugin. It displays the raw x, y, and z magnetometer values and a computed magnitude of the magnetic field.

Installation

cordova plugin add https://github.com/mrameezraja/cordova-plugin-magnetometer

Methods

  • cordova.plugins.magnetoMeter.watchMagnitude
  • cordova.plugins.magnetoMeter.stop

cordova.plugins.magnetoMeter.watchMagnitude


  cordova.plugins.magnetoMeter.watchMagnitude(function(readings){
    console.log(JSON.stringify(readings));
  }, function(error){
    console.log(error);
  })

Readings:

  • magnitude
  • x
  • y
  • z

cordova.plugins.magnetoMeter.stop


  cordova.plugins.magnetoMeter.stop(function(result){
      console.log(result);
  }, function(error){
    console.log(error);
  })

Supported Platforms

  • IOS
  • Android (In Progress)

About

A magnetic field detector plugin. It displays the raw x, y, and z magnetometer values and a computed magnitude of the magnetic field.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published