Closed
Bug 923908
Opened 11 years ago
Closed 7 years ago
Compass API
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 1432631
People
(Reporter: zer0, Unassigned)
Details
It seems that we lacks some Compass API in our browsers – an API useful especially on Firefox OS and Firefox for Android – we should implement them.
I wasn't able to find any specific bug to them, the only one was bug 697361, resolved as WONTFIX. Also, there is no mention about Compass API in https://wiki.mozilla.org/WebAPI.
I'm not also sure what is the situation on W3C – I was able to find just a draft 4 years old: http://dev.w3.org/2009/dap/system-info/compass.html
However, I believe that we should implement such functionality in a way or in another, because it's a standard feature in any mobile phone nowadays – I'm thinking, for instance, about maps application.
Reporter | ||
Comment 1•11 years ago
|
||
As prior art, iOS approach is a bit different from the w3c draft; they added a couple of properties to DeviceOrientation event object:
https://developer.apple.com/library/safari/documentation/SafariDOMAdditions/Reference/DeviceOrientationEventClassRef/DeviceOrientationEvent/DeviceOrientationEvent.html#//apple_ref/doc/uid/TP40010526-CH1-DontLinkElementID_8
Comment 2•11 years ago
|
||
https://developer.mozilla.org/en-US/docs/WebAPI/Detecting_device_orientation
This API is used by a couple of compass apps for Firefox OS.
Reporter | ||
Comment 4•11 years ago
|
||
(In reply to :Ehsan Akhgari (lagging on bugmail, needinfo? me!) from comment #3)
> Matteo, is comment 2 enough for your needs?
Hi, sorry for the long waiting! After I opened the bug during the Mozilla Summit, I talked with some of the Mobile team in Brussels that weren't sure about introducing them, so it slipped out my mind.
My needs are mostly port some web app I did for iOS to Firefox OS and Fennec: but what I need is having the capability to have a Compass as iOS has – so even if you're standing, and not moving, you're able to "detect" where the magnetic north is, with the accuracy.
I'm not sure how the APIs linked in comment 2 can achieve this – of course, if the device has the hw to detect the magnetic field.
Flags: needinfo?(zer0)
Comment 5•11 years ago
|
||
> My needs are mostly port some web app I did for iOS to Firefox OS and
> Fennec: but what I need is having the capability to have a Compass as iOS
> has – so even if you're standing, and not moving, you're able to "detect"
> where the magnetic north is, with the accuracy.
Yes. This is how this API works.
There are actually several compass applications available for firefox OS.
Reporter | ||
Comment 6•11 years ago
|
||
(In reply to Andrea Marchesini (:baku) from comment #5)
> > My needs are mostly port some web app I did for iOS to Firefox OS and
> > Fennec: but what I need is having the capability to have a Compass as iOS
> > has – so even if you're standing, and not moving, you're able to "detect"
> > where the magnetic north is, with the accuracy.
> Yes. This is how this API works.
> There are actually several compass applications available for firefox OS.
I'm not sure then how use them to obtain the magnetic north (not the true north) with accurancy, where the hardware on the device is available. Could you point to me on some example? Thanks!
Comment 7•10 years ago
|
||
I know it's older. But if someone else finds this bug:
Maybe this helps: https://developer.mozilla.org/en-US/demos/detail/simple-compass
Code is here: https://github.com/cgack/cardinal
(In reply to Andrea Marchesini (:baku) from comment #5)
> There are actually several compass applications available for firefox OS.
I had several of them working fine on original zte open with FxOS 1.1 but none of them work on zte open C with FxOS 1.3.
Does anybody have any idea whether its the Open C or Fx1.3 that has the problem, and whether there's any possibility to fix it?
Comment 9•7 years ago
|
||
While this was originally referring to a moz specific FxOS compass API, the w3c Generic Sensor API proposal now covers magnetometers. Dup'ing against our implementation meta bug for that.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•