Skip to main content

Geolocation

Namespace: Wisej.Ext.Geolocation

Assembly: Wisej.Ext.Geolocation

The Geolocation component represents an object able to programmatically obtain the position of the device.

public class Geolocation : Component, IComponent

Constructors

Instance memberGeolocation()

Initializes a new instance of the Geolocation class.

Instance memberGeolocation(container)

Initializes a new instance of the Geolocation class together with the specified container.

NameTypeDescription
containerIContainerA IContainer that represents the container for the component.

Properties

Instance memberActiveWatch

Boolean: Enables or disables active watch mode for this geolocation component. When enabled, the PositionChanged event be fired automatically each time the position of the device changes. (Default: False)

Instance memberEnableHighAccuracy

Boolean: Indicates the application would like to receive the best possible results. (Default: False)

If true and if the device is able to provide a more accurate position, it will do so. Note that this can result in slower response times or increased power consumption (with a GPS chip on a mobile device for example). On the other hand, if false, the device can take the liberty to save resources by responding more quickly and/or using less power.

Instance memberLastPosition

Position: Returns the last position detected by the device.

Instance memberMaximumAge

Int64: Indicates the maximum age in milliseconds of a possible cached position that is acceptable to return. (Default: -1)

If set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. If set to -1 the device must return a cached position regardless of its age.

Instance memberTimeout

Int64: Sets or gets the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. (Default: -1)

Methods

Instance memberGetCurrentPosition(callback)

Returns the current position of the device.

ParameterTypeDescription
callbackAction<Position>

Instance memberGetCurrentPositionAsync()

Asynchronously returns the current position of the device.

Returns: Task<Position>.

Events

Instance memberPositionChanged

EventHandler Fired when the location of the browser changes while this component has an active watch.