# Geolocation Sensor

## Editor’s Draft, 1 January 1970

This version:
  https://w3c.github.io/geolocation-sensor/
Latest published version:
  https://www.w3.org/TR/geolocation-sensor/
Previous Versions:
  https://www.w3.org/TR/2018/WD-geolocation-sensor-20180821/
Feedback:
  public-device-apis@w3.org with subject line “`[geolocation-sensor] … message topic …`” (archives)
Editors:
  Anssi Kostiainen (Intel Corporation)
  Thomas Steiner (Google Inc.)
  Marijn Kruisselbrink (Google Inc.)
Participate:
  GitHub (new issue, open issues)
Tests:
  web-platform-tests
Polyfills:
  geolocation-sensor.js
  geolocation.js

Copyright © 1970 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply.

## Abstract

This specification defines the `GeolocationSensor` interface for obtaining the geolocation of the hosting device.

## Status of this document

This is a public copy of the editors’ draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don’t cite this document other than as work in progress.

If you wish to make comments regarding this document, please send them to public-device-apis@w3.org (subscribe, archives). When sending e-mail, please put the text “geolocation-sensor” in the subject, preferably like this: “[geolocation-sensor] …summary of comment…”. All comments are welcome.

This document was produced by the Devices and Sensors Working Group.

This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 1 March 2019 W3C Process Document.

Note: The work on the Geolocation API [GEOLOCATION-API] has been concluded, and as such, any new feature development is happening in this Geolocation Sensor specification. The two specifications are expected to coexist.

## 1. Introduction

The `GeolocationSensor` API extends the `Sensor` interface [GENERIC-SENSOR] to provide information about the geolocation of the hosting device.

The feature set of the `GeolocationSensor` is similar to that of the Geolocation API [GEOLOCATION-API], but it is surfaced through a modern API that is consistent across contemporary sensor APIs, improves security and privacy, and is extensible. The API aims to be polyfillable (example) on top of the existing Geolocation API.

## 2. Examples

Get a new geolocation reading every second:

    const geo = new GeolocationSensor({ frequency: 1 });
    geo.start();

    geo.onreading = () => console.log(`lat: ${geo.latitude}, long: ${geo.longitude}`);

    geo.onerror = event => console.error(event.error.name, event.error.message);

Get a one-shot geolocation reading:

    GeolocationSensor.read()
      .then(geo => console.log(`lat: ${geo.latitude}, long: ${geo.longitude}`))
      .catch(error => console.error(error.name));

## 3. Security and Privacy Considerations

Note: Investigate any geolocation-specific security and privacy considerations that are not mitigated by the Generic Sensor API [GENERIC-SENSOR], and define geolocation-specific mitigations.

## 4. Model

The term geolocation refers to the real-world geographic location of the hosting device represented in geographic coordinates [WGS84].

Note: An implementation can use multiple location information sources to acquire geolocation information, and this specification is agnostic with respect to those sources.

The Geolocation Sensor sensor type’s associated `Sensor` subclass is the `GeolocationSensor` class.

The Geolocation Sensor has an associated `PermissionName` which is "geolocation".

A latest geolocation reading is a latest reading for a `Sensor` of Geolocation Sensor sensor type. It includes entries whose keys are "latitude", "longitude", "altitude", "accuracy", "altitudeAccuracy", "heading", "speed" and whose values contain the device’s geolocation.

Note: Consider adding a visual of the standard coordinate system for the Earth.

## 5. API

### 5.1. The GeolocationSensor Interface

    [Constructor(optional GeolocationSensorOptions options = {}),
     SecureContext,
     Exposed=(DedicatedWorker, Window)]
    interface GeolocationSensor : Sensor {
      static Promise<GeolocationSensorReading> read(optional ReadOptions readOptions = {});
      readonly attribute unrestricted double? latitude;
      readonly attribute unrestricted double? longitude;
      readonly attribute unrestricted double? altitude;
      readonly attribute unrestricted double? accuracy;
      readonly attribute unrestricted double? altitudeAccuracy;
      readonly attribute unrestricted double? heading;
      readonly attribute unrestricted double? speed;
    };

    dictionary GeolocationSensorOptions : SensorOptions {
      // placeholder for GeolocationSensor-specific options
    };

    dictionary ReadOptions : GeolocationSensorOptions {
      AbortSignal? signal;
    };

    dictionary GeolocationSensorReading {
      DOMHighResTimeStamp? timestamp;
      double? latitude;
      double? longitude;
      double? altitude;
      double? accuracy;
      double? altitudeAccuracy;
      double? heading;
      double? speed;
    };

Normative changes to the `Coordinates` interface of the Geolocation API are the following:

- Use unrestricted double to not throw TypeError on NaN, +Infinity or −Infinity. (Geolocation API defines NaN as a valid value for heading, yet uses double as its type.)
- Use nullable to allow all attributes to default to null. (Geolocation API does not provide synchronous means to access these attributes, thus latitude, longitude, and altitude are not nullable and "must be supported by all implementations".)

To construct a `GeolocationSensor` object the user agent must invoke the construct a geolocation sensor object abstract operation.

#### 5.1.1. GeolocationSensor.read()

The `read()` method, when called, must run the following algorithm:

input

  options, a `ReadOptions` object.

output

  p, a promise.

1. Let p be a new promise.

2. Let options be the first argument.

3. Let signal be the options’ dictionary member of the same name if present, or null otherwise.

4. If signal’s aborted flag is set, then reject p with an "`AbortError`" `DOMException` and return p.

5. Let geo be the result of invoking construct a Geolocation Sensor object with options. If this throws a `DOMException`, catch it, reject p with that `DOMException`, and return p.

6. Invoke geo.`start()`.

7. If signal is not null, then add the following abort steps to signal:

   1. Invoke geo.`stop()`.

   2. Reject p with an "`AbortError`" `DOMException` and abort these steps.

8. Run these steps in parallel:

   1. If notify error is invoked with geo, invoke geo.`stop()`, and reject p with the `DOMException` passed as input to notify error.

   2. If notify new reading is invoked with geo, then resolve a geolocation promise with geo and p.

9. Return p.

Implementations can reuse the same promise for multiple concurrent calls within the same browsing context if the arguments passed to `read()` are the same.

To resolve a geolocation promise means to run the following steps:

1. Let reading be a `GeolocationSensorReading`.

2. For each key → value of latest geolocation reading:

   1. Set reading[key] to value.

3. Invoke geo.`stop()`.

4. Resolve p with reading.

#### 5.1.2. GeolocationSensor.latitude

The `latitude` attribute of the `GeolocationSensor` interface returns the result of invoking get value from latest reading with `this` and "latitude" as arguments. It represents the latitude coordinate of the geolocation in decimal degrees [WGS84].

#### 5.1.3. GeolocationSensor.longitude

The `longitude` attribute of the `GeolocationSensor` interface returns the result of invoking get value from latest reading with `this` and "longitude" as arguments. It represents the longitude coordinate of the geolocation in decimal degrees [WGS84].

#### 5.1.4. GeolocationSensor.altitude

The `altitude` attribute of the `GeolocationSensor` interface returns the result of invoking get value from latest reading with `this` and "altitude" as arguments. It represents the geolocation in meters above the WGS 84 ellipsoid [WGS84].

#### 5.1.5. GeolocationSensor.accuracy

The `accuracy` attribute of the `GeolocationSensor` interface returns the result of invoking get value from latest reading with `this` and "accuracy" as arguments. It represents the accuracy of the latest reading["latitude"] value and latest reading["longitude"] value in meters with a 95% confidence level.

If the latest reading["latitude"] value is null or latest reading["longitude"] value is null, it must return null.

#### 5.1.6. GeolocationSensor.altitudeAccuracy

The `altitudeAccuracy` attribute of the `GeolocationSensor` interface returns the result of invoking get value from latest reading with `this` and "altitudeAccuracy" as arguments. It represents the accuracy of the latest reading["altitude"] value in meters with a 95% confidence level.

If the latest reading["altitude"] value is null, it must return null.

#### 5.1.7. GeolocationSensor.heading

The `heading` attribute of the `GeolocationSensor` interface returns the result of invoking get value from latest reading with `this` and "heading" as arguments. It represents the direction of travel in degrees counting clockwise relative to the true north in the range 0 ≤ heading ≤ 360.

#### 5.1.8. GeolocationSensor.speed

The `speed` attribute of the `GeolocationSensor` interface returns the result of invoking get value from latest reading with `this` and "speed" as arguments. It represents the magnitude of the horizontal component of the velocity in meters per second.

## 6. Abstract Operations

### 6.1. Construct a geolocation sensor object

input

  options, a `GeolocationSensorOptions` object.

output

  A `GeolocationSensor` object.

1. Let allowed be the result of invoking check sensor policy-controlled features with `GeolocationSensor`.

2. If allowed is false, then:

   1. Throw a `SecurityError` `DOMException`.

3. Let geo be the new `GeolocationSensor` object.

4. Invoke initialize a sensor object with geo and options.

5. Return geo.

## 7. Automation

This section extends the automation section defined in the Generic Sensor API [GENERIC-SENSOR] to provide mocking information about the geolocation of the hosting device for the purposes of testing a user agent’s implementation of `GeolocationSensor` API.

### 7.1. Mock Sensor Type

The `GeolocationSensor` class has an associated mock sensor type which is "geolocation", its mock sensor reading values dictionary is defined as follows:

    dictionary GeolocationReadingValues {
      required double? latitude;
      required double? longitude;
      required double? altitude;
      required double? accuracy;
      required double? altitudeAccuracy;
      required double? heading;
      required double? speed;
    };

## 8. Use Cases

### 8.1. Categorization of use cases

The mentioned use cases can roughly be grouped into four categories:

- Foreground operations:

  - Getting a one-off geolocation update.

  - Getting continuous geolocation updates (aka. foreground geotracking).

- Background operations:

  - Getting continuous geolocation updates (aka. background geotracking).

  - Getting a one-off geolocation fence alert (aka. background geofencing).

Note: Only the foreground operations were possible with [GEOLOCATION-API], the background operations are completely novel.

Core constraints when obtaining the gelocation are accuracy (how close to the actual position of the user is the determined position) and latency (how long does the user want to wait for a result). Both are tradeoffs: one can trade faster results for lower accuracy and vice versa.

A common theme is to first obtain a rough estimation that then gets refined over time, for example based initially on surrounding WiFi signals (which is fast to obtain) and then eventually based on precise GPS data (which may take some time to find a signal).

In the following, we list use cases based on the previously defined categories.

Note: The categories are not mutually exclusive and overlaps exist. A task might start in the foreground, then continue in the background (for example, while the user quickly responds to an incoming email), and then eventually terminate in the foreground when the user multitasks back.

### 8.2. Foreground—One-off geolocation update

#### 8.2.1. Locate a user on a map

A mapping application can use the Geolocation Sensor API data of a user to locate them on the map, essentially responding to the question "Where am I right now?"

#### 8.2.2. Find points of interest in the user’s area

Someone visiting a foreign city could access a web application that allows users to search or browse through a database of tourist attractions. Using the Geolocation Sensor API, the web application has access to the user’s approximate current position and is therefore able to rank the search results by proximity to the user’s location.

### 8.3. Foreground—Continuous geolocation updates

#### 8.3.1. Up-to-date local information

A widget-like web application that shows the weather or news that are relevant to the user’s current area can use the Geolocation Sensor API to register for location updates. If the user’s position changes, the widget can adapt the content accordingly.

#### 8.3.2. Alerts when points of interest are in the user’s vicinity

A tour guide web application can use the Geolocation Sensor API to monitor the user’s position and trigger visual or audio notifications when interesting places are in the vicinity. An online task management system can trigger reminders when the user is in the proximity of landmarks that are associated with certain tasks. This use case assumes active usage of the application in the foreground.

#### 8.3.3. Show the user’s position on a map

A user finds themselves in an unfamiliar area. They want to check their position so they use their handheld device to navigate to a web-based mapping application that can pinpoint their exact location on the map using the Geolocation Sensor API. They then ask the web application to provide driving directions from their current position to their desired destination, essentially responding to the question "Where am I going?".

### 8.4. Background—Continuous geolocation updates

#### 8.4.1. Location-tagged status updates in social networking applications

A social networking application allows its users to automatically tag their status updates with location information. It does this by monitoring the user’s position with the Geolocation Sensor API. Each user can control the granularity of the location information (e.g., city or neighborhood level) that is shared with the other users. Any user can also see their network of friends and get real-time updates about their current location, granted they have opted in to their location data being shared. This use case intentionally conflates foreground location tagging and background location sharing.

#### 8.4.2. Turn-by-turn route navigation

A mapping application can help the user navigate along a routeby providing detailed turn-by-turn directions. The application does this by registering with the Geolocation Sensor API to receive repeated location updates of the user’s position. These updates are delivered as soon as the implementing user agent determines that the position of the user has changed, which allows the application to anticipate any changes of direction that the user might need to do. The application can be in the foreground, but likewise can be backgrounded, for example, when the user turns their device off to save battery on a long highway route section without side roads.

#### 8.4.3. Tracking sports activity

A web application can track a user’s sports activity, for example, a marathon run or a bicycle race. Therefore, the application does not need to be on the screen, but would be backgrounded while the user performs their activity, maybe with their handheld device strapped to their arm.

#### 8.4.4. Real estate search

A web application on a handheld device can notify a user of interesting available properties in a neighborhood they are passing by where the property fits the user’s previously specified search criteria, for example, 3 bedroom apartments with balcony. This is based on the assumption that the number of possible matches is high, that is, impossible to realize with geofences as the amount of required geofences would be too high.

### 8.5. Background—One-off geolocation fence alert

#### 8.5.1. Reminder and to-do applications

Reminder and to-do web applications can use a geofence to remind the user to do something when they cross it, for example, to buy milk when they are near the supermarket.

#### 8.5.2. Travel applications

Travel applications can show venue specific data like WiFi passwords, the user’s booking confirmation etc. only within geofence boundaries.

#### 8.5.3. Ticketing or booking confirmations

Ticketing or booking applications can bring up a ticket notification with a QR or bar code once the user is near the venue of a concert or sports event or when they reach their rental car counter or similar.

#### 8.5.4. Ride share applications

Users can be informed if their designated driver reaches a pre-defined pickup point.

#### 8.5.5. Retail special offers

Given their previous consent, a user with a retailer’s web application installed on their handheld device can be alerted about special offers or location-based coupons when they are in vicinity of a physical presence of the retailer. Further, the in-store experience can be enriched, for example, the retailer can let the user know something they have looked at before is actually available for pick up nearby.

## 9. Acknowledgements

Thanks to Tobie Langel for the work on Generic Sensor API and the early geolocation.js polyfill.

Thanks to Kenneth Rohde Christiansen for the geolocation-sensor.js polyfill and design proposals during the incubation phase.

Special thanks to the Geolocation Working Group participants for their work on the Geolocation API from 2008 until 2017.

## Index

### Terms defined by this specification

- accuracy
  - attribute for GeolocationSensor, in §5.1
  - dict-member for GeolocationReadingValues, in §7.1
  - dict-member for GeolocationSensorReading, in §5.1
- altitude
  - attribute for GeolocationSensor, in §5.1
  - dict-member for GeolocationReadingValues, in §7.1
  - dict-member for GeolocationSensorReading, in §5.1
- altitudeAccuracy
  - attribute for GeolocationSensor, in §5.1
  - dict-member for GeolocationReadingValues, in §7.1
  - dict-member for GeolocationSensorReading, in §5.1
- Construct a geolocation sensor object, in §6
- geolocation, in §4
- GeolocationReadingValues, in §7.1
- Geolocation Sensor, in §4
- GeolocationSensor, in §5.1
- GeolocationSensorOptions, in §5.1
- GeolocationSensorReading, in §5.1
- heading
  - attribute for GeolocationSensor, in §5.1
  - dict-member for GeolocationReadingValues, in §7.1
  - dict-member for GeolocationSensorReading, in §5.1
- latest geolocation reading, in §4
- latitude
  - attribute for GeolocationSensor, in §5.1
  - dict-member for GeolocationReadingValues, in §7.1
  - dict-member for GeolocationSensorReading, in §5.1
- longitude
  - attribute for GeolocationSensor, in §5.1
  - dict-member for GeolocationReadingValues, in §7.1
  - dict-member for GeolocationSensorReading, in §5.1
- read(), in §5.1
- ReadOptions, in §5.1
- read(readOptions), in §5.1
- resolve a geolocation promise, in §5.1.1
- signal, in §5.1
- speed
  - attribute for GeolocationSensor, in §5.1
  - dict-member for GeolocationReadingValues, in §7.1
  - dict-member for GeolocationSensorReading, in §5.1
- timestamp, in §5.1

https://dom.spec.whatwg.org/#abortsignal Referenced in:

- 5.1. The GeolocationSensor Interface

https://dom.spec.whatwg.org#abortsignal-aborted-flag Referenced in:

- 5.1.1. GeolocationSensor.read()

https://dom.spec.whatwg.org#abortsignal-add Referenced in:

- 5.1.1. GeolocationSensor.read()

https://w3c.github.io/sensors/#dom-mocksensortype-geolocation Referenced in:

- 7.1. Mock Sensor Type

https://w3c.github.io/sensors/#sensor Referenced in:

- 1. Introduction
- 4. Model (2)
- 5.1. The GeolocationSensor Interface

https://w3c.github.io/sensors/#dictdef-sensoroptions Referenced in:

- 5.1. The GeolocationSensor Interface

https://w3c.github.io/sensors#automation Referenced in:

- 7. Automation

https://w3c.github.io/sensors#check-sensor-policy-controlled-features Referenced in:

- 6.1. Construct a geolocation sensor object

https://w3c.github.io/sensors#extensibility Referenced in:

- 1. Introduction

https://w3c.github.io/sensors/#get-value-from-latest-reading Referenced in:

- 5.1.2. GeolocationSensor.latitude
- 5.1.3. GeolocationSensor.longitude
- 5.1.4. GeolocationSensor.altitude
- 5.1.5. GeolocationSensor.accuracy
- 5.1.6. GeolocationSensor.altitudeAccuracy
- 5.1.7. GeolocationSensor.heading
- 5.1.8. GeolocationSensor.speed

https://w3c.github.io/sensors#initialize-a-sensor-object Referenced in:

- 6.1. Construct a geolocation sensor object

https://w3c.github.io/sensors#latest-reading Referenced in:

- 4. Model
- 5.1.5. GeolocationSensor.accuracy (2) (3) (4)
- 5.1.6. GeolocationSensor.altitudeAccuracy (2)

https://w3c.github.io/sensors#mock-sensor-reading-values Referenced in:

- 7.1. Mock Sensor Type

https://w3c.github.io/sensors#mock-sensor-type Referenced in:

- 7.1. Mock Sensor Type

https://w3c.github.io/sensors/#notify-error Referenced in:

- 5.1.1. GeolocationSensor.read() (2)

https://w3c.github.io/sensors/#notify-new-reading Referenced in:

- 5.1.1. GeolocationSensor.read()

https://w3c.github.io/sensors#security-and-privacy Referenced in:

- 1. Introduction

https://w3c.github.io/sensors#sensor-type Referenced in:

- 4. Model (2)

https://w3c.github.io/sensors/#dom-sensor-start Referenced in:

- 5.1.1. GeolocationSensor.read()

https://w3c.github.io/sensors/#dom-sensor-stop Referenced in:

- 5.1.1. GeolocationSensor.read() (2) (3)

http://w3c.github.io/hr-time/#dom-domhighrestimestamp Referenced in:

- 5.1. The GeolocationSensor Interface

https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel Referenced in:

- 5.1.1. GeolocationSensor.read()

https://infra.spec.whatwg.org/#map-entry Referenced in:

- 4. Model

https://infra.spec.whatwg.org/#list-iterate Referenced in:

- 5.1.1. GeolocationSensor.read()

https://infra.spec.whatwg.org/#map-key Referenced in:

- 4. Model

https://infra.spec.whatwg.org/#map-set Referenced in:

- 5.1.1. GeolocationSensor.read()

https://infra.spec.whatwg.org/#map-value Referenced in:

- 4. Model

https://w3c.github.io/permissions/#dom-permissionname-geolocation Referenced in:

- 4. Model

https://w3c.github.io/permissions/#enumdef-permissionname Referenced in:

- 4. Model

https://heycam.github.io/webidl/#aborterror Referenced in:

- 5.1.1. GeolocationSensor.read() (2)

https://heycam.github.io/webidl/#idl-DOMException Referenced in:

- 5.1.1. GeolocationSensor.read() (2) (3) (4) (5)
- 6.1. Construct a geolocation sensor object

https://heycam.github.io/webidl/#Exposed Referenced in:

- 5.1. The GeolocationSensor Interface

https://heycam.github.io/webidl/#SecureContext Referenced in:

- 5.1. The GeolocationSensor Interface

https://heycam.github.io/webidl/#securityerror Referenced in:

- 6.1. Construct a geolocation sensor object

https://heycam.github.io/webidl/#idl-double Referenced in:

- 5.1. The GeolocationSensor Interface (2) (3) (4) (5) (6) (7)
- 7.1. Mock Sensor Type (2) (3) (4) (5) (6) (7)

https://heycam.github.io/webidl/#dfn-throw Referenced in:

- 6.1. Construct a geolocation sensor object

https://heycam.github.io/webidl/#idl-unrestricted-double Referenced in:

- 5.1. The GeolocationSensor Interface (2) (3) (4) (5) (6) (7) (8)

### Terms defined by reference

- [DOM] defines the following terms:
  - AbortSignal
  - aborted flag
  - add the following abort steps
- [GENERIC-SENSOR] defines the following terms:
  - "geolocation"
  - Sensor
  - SensorOptions
  - automation
  - check sensor policy-controlled features
  - extensible
  - get value from latest reading
  - initialize a sensor object
  - latest reading
  - mock sensor reading values
  - mock sensor type
  - notify error
  - notify new reading
  - security and privacy
  - sensor type
  - start()
  - stop()
- [hr-time-2] defines the following terms:
  - DOMHighResTimeStamp
- [HTML] defines the following terms:
  - in parallel
- [INFRA] defines the following terms:
  - entry
  - for each
  - key
  - set
  - value
- [permissions] defines the following terms:
  - "geolocation"
  - PermissionName
- [WebIDL] defines the following terms:
  - AbortError
  - DOMException
  - Exposed
  - SecureContext
  - SecurityError
  - double
  - throw
  - unrestricted double

## References

### Normative References

[DOM]
  Anne van Kesteren. DOM Standard. Living Standard. URL: https://dom.spec.whatwg.org/
[GENERIC-SENSOR]
  Mikhail Pozdnyakov; Alexander Shalamov; Tobie Langel. Generic Sensor API. URL: https://w3c.github.io/sensors/
[HR-TIME-2]
  Ilya Grigorik; James Simonsen; Jatinder Mann. High Resolution Time Level 2. URL: https://w3c.github.io/hr-time/
[HTML]
  Anne van Kesteren; et al. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/
[INFRA]
  Anne van Kesteren; Domenic Denicola. Infra Standard. Living Standard. URL: https://infra.spec.whatwg.org/
[PERMISSIONS]
  Mounir Lamouri; Marcos Caceres; Jeffrey Yasskin. Permissions. URL: https://w3c.github.io/permissions/
[WebIDL]
  Boris Zbarsky. Web IDL. URL: https://heycam.github.io/webidl/
[WGS84]
  National Imagery and Mapping Agency. Department of Defence World Geodetic System 1984. Technical Report, Third Edition. URL: http://earth-info.nga.mil/GandG/publications/tr8350.2/wgs84fin.pdf

### Informative References

[GEOLOCATION-API]
  Andrei Popescu. Geolocation API Specification 2nd Edition. URL: http://dev.w3.org/geo/api/spec-source.html

## IDL Index

    [Constructor(optional GeolocationSensorOptions options = {}),
     SecureContext,
     Exposed=(DedicatedWorker, Window)]
    interface GeolocationSensor : Sensor {
      static Promise<GeolocationSensorReading> read(optional ReadOptions readOptions = {});
      readonly attribute unrestricted double? latitude;
      readonly attribute unrestricted double? longitude;
      readonly attribute unrestricted double? altitude;
      readonly attribute unrestricted double? accuracy;
      readonly attribute unrestricted double? altitudeAccuracy;
      readonly attribute unrestricted double? heading;
      readonly attribute unrestricted double? speed;
    };

    dictionary GeolocationSensorOptions : SensorOptions {
      // placeholder for GeolocationSensor-specific options
    };

    dictionary ReadOptions : GeolocationSensorOptions {
      AbortSignal? signal;
    };

    dictionary GeolocationSensorReading {
      DOMHighResTimeStamp? timestamp;
      double? latitude;
      double? longitude;
      double? altitude;
      double? accuracy;
      double? altitudeAccuracy;
      double? heading;
      double? speed;
    };

    dictionary GeolocationReadingValues {
      required double? latitude;
      required double? longitude;
      required double? altitude;
      required double? accuracy;
      required double? altitudeAccuracy;
      required double? heading;
      required double? speed;
    };

#geolocation Referenced in:

- 1. Introduction
- 4. Model (2)
- 5.1.2. GeolocationSensor.latitude
- 5.1.3. GeolocationSensor.longitude
- 5.1.4. GeolocationSensor.altitude
- 7. Automation

#geolocation-sensor Referenced in:

- 4. Model (2)

#latest-geolocation-reading Referenced in:

- 5.1.1. GeolocationSensor.read()

#geolocationsensor Referenced in:

- 1. Introduction (2)
- 4. Model
- 5.1. The GeolocationSensor Interface
- 5.1.2. GeolocationSensor.latitude
- 5.1.3. GeolocationSensor.longitude
- 5.1.4. GeolocationSensor.altitude
- 5.1.5. GeolocationSensor.accuracy
- 5.1.6. GeolocationSensor.altitudeAccuracy
- 5.1.7. GeolocationSensor.heading
- 5.1.8. GeolocationSensor.speed
- 6.1. Construct a geolocation sensor object (2) (3)
- 7. Automation
- 7.1. Mock Sensor Type

#dom-geolocationsensor-read Referenced in:

- 5.1.1. GeolocationSensor.read() (2)

#dom-geolocationsensor-latitude Referenced in:

- 5.1.2. GeolocationSensor.latitude

#dom-geolocationsensor-longitude Referenced in:

- 5.1.3. GeolocationSensor.longitude

#dom-geolocationsensor-altitude Referenced in:

- 5.1.4. GeolocationSensor.altitude

#dom-geolocationsensor-accuracy Referenced in:

- 5.1.5. GeolocationSensor.accuracy

#dom-geolocationsensor-altitudeaccuracy Referenced in:

- 5.1.6. GeolocationSensor.altitudeAccuracy

#dom-geolocationsensor-heading Referenced in:

- 5.1.7. GeolocationSensor.heading

#dom-geolocationsensor-speed Referenced in:

- 5.1.8. GeolocationSensor.speed

#dictdef-geolocationsensoroptions Referenced in:

- 5.1. The GeolocationSensor Interface (2)
- 6.1. Construct a geolocation sensor object

#dictdef-readoptions Referenced in:

- 5.1. The GeolocationSensor Interface
- 5.1.1. GeolocationSensor.read()

#dictdef-geolocationsensorreading Referenced in:

- 5.1. The GeolocationSensor Interface
- 5.1.1. GeolocationSensor.read()

#resolve-a-geolocation-promise Referenced in:

- 5.1.1. GeolocationSensor.read()

#construct-a-geolocation-sensor-object Referenced in:

- 5.1. The GeolocationSensor Interface
- 5.1.1. GeolocationSensor.read()