Table of Contents

Class Magnetometer

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The Magnetometer interface of the Sensor APIs provides information about the magnetic field as detected by the device's primary magnetometer sensor.
[Value("Magnetometer")]
public class Magnetometer : Sensor
Inheritance
Magnetometer
Inherited Members

Remarks

To use this sensor, the user must grant permission to the 'magnetometer' device sensor through the Permissions API. In addition, this feature may be blocked by a Permissions Policy set on your server.

See also on MDN

Constructors

Magnetometer()

public Magnetometer()

Magnetometer(MagnetometerSensorOptions)

NOTE
Experimental
The Magnetometer() constructor
creates a new Magnetometer object which returns information about the
magnetic field as detected by a device's primary magnetometer sensor.
public Magnetometer(MagnetometerSensorOptions sensorOptions = null)

Parameters

sensorOptions MagnetometerSensorOptions

Remarks

-'sensor.Reading' event

See also on MDN

Properties

X

NOTE
Experimental
The x read-only property of the
Magnetometer interface returns a number specifying
the magnetic field around the device's x-axis.
[Value("x")]
public Number? X { get; }

Property Value

Number

A 'Number'.

Remarks

Y

NOTE
Experimental
The y read-only property of the
Magnetometer interface returns a number specifying
the magnetic field around the device's y-axis.
[Value("y")]
public Number? Y { get; }

Property Value

Number

A 'Number'.

Remarks

Z

NOTE
Experimental
The z read-only property of the
Magnetometer interface returns a number specifying
the magnetic field around the device's z-axis.
[Value("z")]
public Number? Z { get; }

Property Value

Number

A 'Number'.

Remarks