Interface Geolocation
interface Geolocation {
clearWatch(watchId: number): void;
getCurrentPosition(
successCallback: PositionCallback,
errorCallback?: PositionErrorCallback,
options?: PositionOptions,
): void;
watchPosition(
successCallback: PositionCallback,
errorCallback?: PositionErrorCallback,
options?: PositionOptions,
): number;
}
clearWatch(watchId: number): void;
getCurrentPosition(
successCallback: PositionCallback,
errorCallback?: PositionErrorCallback,
options?: PositionOptions,
): void;
watchPosition(
successCallback: PositionCallback,
errorCallback?: PositionErrorCallback,
options?: PositionOptions,
): number;
}
Index
Methods
clearWatch
getCurrentPosition
- getCurrentPosition(
successCallback: PositionCallback,
errorCallback?: PositionErrorCallback,
options?: PositionOptions,
): void Parameters
- successCallback: PositionCallback
Optional
errorCallback: PositionErrorCallbackOptional
options: PositionOptions
Returns void
watchPosition
- watchPosition(
successCallback: PositionCallback,
errorCallback?: PositionErrorCallback,
options?: PositionOptions,
): number Parameters
- successCallback: PositionCallback
Optional
errorCallback: PositionErrorCallbackOptional
options: PositionOptions
Returns number
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.
MDN Reference