Hi Jacks,

you need the deviceorientation event, using the event property alpha.

The event API: 
https://developer.mozilla.org/en-US/docs/DOM/Mozilla_event_reference/deviceorientation

A demo: https://developer.mozilla.org/en-US/demos/detail/simple-compass/launch

And some more in-depth description of the values: 
https://developer.mozilla.org/en-US/docs/DOM/Orientation_and_motion_data_explained

Good luck! 

---
Harald Kirschner | Partner Engineer & Web Craftsman | [email protected] 
(mailto:[email protected])


On Monday, April 29, 2013 at 8:53 AM, Jacks wrote:

> Hi guys
> 
> I'm a begginer in web apps and I'm trying to get the magnetic field values x, 
> y and z, like I do in Android, but I don't know how to do that. 
> On this page 
> https://developer.mozilla.org/en-US/docs/DOM/Mozilla_event_reference
> there is no reference to magnetometer in SensorEvents. I can get the values 
> from accelerometer, gyroscope and every other sensor except magnetometer. 
> 
> thank you guys 
> _______________________________________________
> dev-webapps mailing list
> [email protected] (mailto:[email protected])
> https://lists.mozilla.org/listinfo/dev-webapps
> 
> 


_______________________________________________
dev-webapps mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-webapps

Reply via email to