Name

GeolocationError — an error while querying the user’s location

Synopsis

If an attempt to determine the user’s geographical position fails, your error callback function will be invoked with a GeolocationError object that describes what went wrong.

Constants

These constants are the possible values of the code property:

unsigned short PERMISSION_DENIED = 1

The user did not grant permission to share her or his location.

unsigned short POSITION_UNAVAILABLE = 2

The location could not be determined for an unspecified reason. This could be caused by a network error, for example.

unsigned short TIMEOUT = 3

The location could not be determined within the time allotted (see the timeout option described in Geolocation).

Properties

readonly unsigned short code

This property will have one of the three values above.

readonly string message

A message that provides more details about the error. The message is intended to aid with debugging and is not suitable for display to end users.

Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.