W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2017

[whatwg] When to use the new GeolocationSensor API?

From: Richard Maher <maherrj@googlemail.com>
Date: Tue, 26 Sep 2017 08:58:10 +0800
Message-ID: <CABvL1xrCgTcn=eO=VL6KjHQX=sFW7c_im-gHJ-kTd9PsjHzfPQ@mail.gmail.com>
To: WHAT Working Group <whatwg@whatwg.org>
When would one opt to use the Sensor GeoLocation
<https://www.w3.org/TR/generic-sensor/#background> API as opposed to the
existing standard navigator.geolocation.watchPosition?

Can someone explain the added value of this second API or the use-cases
that can be solved by the sensor API that cannot be handled here

The Web App world desperately needs a background geolocation capability but
the sensor API architecturally prohibits this.

What is the point of the following redundant interface to geolocation: -

let sensor = new GeolocationSensor({ accuracy: "high" });

sensor.onreading = function(event) {
    var coords = [sensor.latitude, sensor.longitude];
    updateMap(null, coords, sensor.accuracy);};

sensor.onerror = function(error) {

If technical merit contributes to W3C/IETF resource allocation surely the
battery efficient background geolocation solution proposed here
<https://drive.google.com/open?id=0B7Rmd3Rn8_hDNW1zSWRoXzBTclU> is what
should be promoted?
Received on Tuesday, 26 September 2017 00:58:39 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:44 UTC