GeolocationUtils
Geolocation utilities
Static Method Summary
Static Public Methods | ||
public static |
unregister location/error monitoring handlers previously installed using GeolocationUtils.enable |
|
public static |
Calculates the distance between two points on Earth |
|
public static |
Registers a handler function that will be called automatically each time the position of the device changes. |
|
public static |
getCurrent(callback: Function, errorCallback: Function) Gets the current position of the device. |
Static Public Methods
public static disable(watcher: number) source
unregister location/error monitoring handlers previously installed using GeolocationUtils.enable
Params:
Name | Type | Attribute | Description |
watcher | number | Watch ID value returned by GeolocationUtils.enable |
public static distance(lat1: number, lng1: number, lat2: number, lng2: number): number source
Calculates the distance between two points on Earth
public static enable(callback: Function, errorCallback: Function): number source
Registers a handler function that will be called automatically each time the position of the device changes. You can also, optionally, specify an error handling callback function.
Params:
Name | Type | Attribute | Description |
callback | Function | Takes a Position object as an input parameter. |
|
errorCallback | Function | Takes a PositionError object as an input parameter. |
Return:
number | A watch ID value that then can be used to unregister the handler using GeolocationUtils.disable |