Clear Up
SharpKit Reference

GeoLocation Class

Namespace: Ext.util

Base Types

System.Object

Properties

Name Description
accuracy Read-only property representing the last retrieved accuracy level of the latitude and longitude coordinates, specified in meters.
This will always be a non-negative number.
This corresponds to a 95% confidence level. @type Number
allowHighAccuracy @cfg {Boolean} allowHighAccuracy When set to true, provide a hint that the application would like to receive the best possible results. This may result in slower response times or increased power consumption. The user might also deny this capability, or the device might not be able to provide more accurate results than if this option was set to false.
AllowHighAccuracy Changes the {@link #allowHighAccuracy} option and restarts any active location monitoring with the updated setting. @param {Number} allowHighAccuracy The value to set the allowHighAccuracy option to.
altitude Read-only property representing the last retrieved height of the position, specified in meters above the ellipsoid [WGS84]. @type Number
altitudeAccuracy Read-only property representing the last retrieved accuracy level of the altitude coordinate, specified in meters.
If altitude is not null then this will be a non-negative number. Otherwise this returns null.
This corresponds to a 95% confidence level. @type Number
autoUpdate @cfg {Boolean} autoUpdate When set to true, continually monitor the location of the device (beginning immediately) and fire {@link #locationupdate}/{@link #locationerror} events. When using google gears, if the user denies access or another error occurs, this will be reset to false.
AutoUpdate Enabled/disables the auto-retrieval of the location information.
If called with autoUpdate=true, it will execute an immediate location update and continue monitoring for location updates.
If autoUpdate=false, any current location change monitoring will be disabled. A {@link #locationerror} event is fired if the location cannot be determined due di an error supporting geolocation. @param {Boolean} autoUpdate Whether to start/stop location monitoring. @return {Boolean} If enabling autoUpdate, returns false if the location tracking cannot begin due to an error supporting geolocation.
heading Read-only property representing the last retrieved direction of travel of the hosting device, specified in non-negative degrees between 0 and 359, counting clockwise relative to the true north.
If speed is 0 (device is stationary), then this returns NaN @type Number
latitude Read-only property representing the last retrieved geographical coordinate specified in degrees. @type Number
longitude Read-only property representing the last retrieved geographical coordinate specified in degrees. @type Number
maximumAge @cfg {Number} maximumAge This option indicates that the application is willing to accept cached location information whose age is no greater than the specified time in milliseconds. If maximumAge is set to 0, an attempt to retrieve new location information is made immediately.
Setting the maximumAge to Infinity returns a cached position regardless of its age.
If the device does not have cached location information available whose age is no greater than the specified maximumAge, then it must acquire new location information.
For example, if location information no older than 10 minutes is required, set this property to 600000.
MaximumAge Changes the {@link #maximumAge} option and restarts any active location monitoring with the updated setting. @param {Number} maximumAge The value to set the maximumAge option to.
provider
speed Read-only property representing the last retrieved current ground speed of the device, specified in meters per second.
If this feature is unsupported by the device, this returns null.
If the device is stationary, this returns 0, otherwise it returns a non-negative number. @type Number
Timeout Changes the {@link #timeout} option and restarts any active location monitoring with the updated setting. @param {Number} timeout The value to set the timeout option to.
timestamp Read-only property representing when the last retrieved positioning information was acquired by the device. @type Date
watchOperation

Methods

Name Description
fireError(object)
fireUpdate(object)
getLocation(object, object) @private Returns cached coordinates, and updates if there are no cached coords yet. @deprecated
parseOptions()
setAllowHighAccuracy(JsNumber) Changes the {@link #allowHighAccuracy} option and restarts any active location monitoring with the updated setting. @param {Number} allowHighAccuracy The value to set the allowHighAccuracy option to.
setAutoUpdate(bool) Enabled/disables the auto-retrieval of the location information.
If called with autoUpdate=true, it will execute an immediate location update and continue monitoring for location updates.
If autoUpdate=false, any current location change monitoring will be disabled. A {@link #locationerror} event is fired if the location cannot be determined due di an error supporting geolocation. @param {Boolean} autoUpdate Whether to start/stop location monitoring. @return {Boolean} If enabling autoUpdate, returns false if the location tracking cannot begin due to an error supporting geolocation.
setMaximumAge(JsNumber) Changes the {@link #maximumAge} option and restarts any active location monitoring with the updated setting. @param {Number} maximumAge The value to set the maximumAge option to.
setTimeout(JsNumber) Changes the {@link #timeout} option and restarts any active location monitoring with the updated setting. @param {Number} timeout The value to set the timeout option to.
updateLocation(JsAction, object, object) Executes a onetime location update operation, raising either a {@link #locationupdate} or {@link #locationerror} event.
Does not interfere with or restart ongoing location monitoring. @param {Function} callback A callback method to be called when the location retrieval has been completed.
Will be called on both success and failure.
The method will be passed one parameter, {@link Ext.util.GeoLocation} (this reference), set to null on failure.
  
geo.updateLocation(function (geo) {
alert('Latitude: ' + (geo != null ? geo.latitude : 'failed'));
});
            
@param {Object} scope (optional) (optional) The scope (this reference) in which the handler function is executed. If omitted, defaults to the object which fired the event.
© Copyright 2005-2011 SharpKit. All rights reserved.