Version: Smart Feature Phone 3.0

navigator.geolocation

Description#

The Geolocation interface represents an object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location. For web site, this API is available only in secure contexts (HTTPS). For packaged app, 'geolocation' permission is required to use the API. (i.e. The developer must add the permisson to the manifest.webmanifest)

An object with this interface is obtained using the navigator.geolocation property implemented by the Navigator object.

Interface overview#

interface Geolocation {
void getCurrentPosition(PositionCallback successCallback,
optional PositionErrorCallback? errorCallback = null,
optional PositionOptions options = {});
long watchPosition(PositionCallback successCallback,
optional PositionErrorCallback? errorCallback = null,
optional PositionOptions options = {});
void clearWatch(long watchId);
};

Properties#

The Geolocation interface neither implements, nor inherits any property.

Methods#

The Geolocation interface doesn't inherit any method.

For information about the API usage, see the MDN Web Docs