Geolocator.DesiredAccuracy | desiredAccuracy property

Applies to Windows and Windows Phone

The accuracy level at which the Geolocator provides location updates.

Syntax


Public Property DesiredAccuracy As PositionAccuracy

Property value

Type: PositionAccuracy

The accuracy level at which the Geolocator provides location updates.

Remarks

Set DesiredAccuracy to High only if your application requires the most accurate data available. Set DesiredAccuracy to Default to optimize for power.

Setting the DesiredAccuracy property of the Geolocator object is not guaranteed to have an effect on the accuracy of data.

The DesiredAccuracyInMeters property provides more granularity and control of the accuracy of the position results. Most applications can simply use the DesiredAccuracy property.

  • Applies to Windows

Note   On Windows, if DesiredAccuracyInMeters is not null, its value overrides the value of DesiredAccuracy.

  • Applies to Windows Phone

Note  On Windows Phone, if DesiredAccuracyInMeters is not null, its value overrides the value of DesiredAccuracy and the getter for DesiredAccuracy will return E_FAIL. Setting the value of DesiredAccuracy sets DesiredAccuracyInMeters to null.

Examples

The following example shows how to set the desired accuracy in JavaScript.


var geolocator = new Windows.Devices.Geolocation.Geolocator();
geolocator.desiredAccuracy = Windows.Devices.Geolocation.PositionAccuracy.default;
geolocator.desiredAccuracy = Windows.Devices.Geolocation.PositionAccuracy.high;


The following example shows how to set the desired accuracy in C#.


Geolocator geolocator = new Geolocator();
geolocator.DesiredAccuracy = Windows.Devices.Geolocation.PositionAccuracy.Default;
geolocator.DesiredAccuracy = Windows.Devices.Geolocation.PositionAccuracy.High;

Requirements

Minimum supported client

Windows 8

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8

Namespace

Windows.Devices.Geolocation
Windows::Devices::Geolocation [C++]

Metadata

Windows.winmd

Capabilities

location
ID_CAP_LOCATION [Windows Phone]

See also

Geolocator

 

 

Show:
© 2014 Microsoft