Geolocator.DesiredAccuracy | desiredAccuracy property

0 out of 1 rated this helpful - Rate this topic

The accuracy level at which the Geolocator provides location updates.

Syntax


var desiredAccuracy = geolocator.desiredAccuracy;
geolocator.desiredAccuracy = desiredAccuracy;

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.

Windows Phone 8:  On Windows Phone 8, 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

Windows Server 2012

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

 

 

Build date: 2/25/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.