Geolocator.DesiredAccuracy Geolocator.DesiredAccuracy Geolocator.DesiredAccuracy Geolocator.DesiredAccuracy Geolocator.DesiredAccuracy Property

Definition

The accuracy level at which the Geolocator provides location updates.

public : PositionAccuracy DesiredAccuracy { get; set; }
PositionAccuracy DesiredAccuracy();

void DesiredAccuracy(PositionAccuracy desiredaccuracy);
public PositionAccuracy DesiredAccuracy { get; set; }
Public ReadWrite Property DesiredAccuracy As PositionAccuracy
var positionAccuracy = geolocator.desiredAccuracy;
geolocator.desiredAccuracy = positionAccuracy;

Property Value

The accuracy level at which the Geolocator provides location updates.

Additional features and requirements

Capabilities
location ID_CAP_LOCATION [Windows Phone]

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;

Remarks

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

Note

Some hardware may not support high accuracy location data. If your app attempts to set accuracy to a value that’s not supported, accuracy will be set to the limit that the hardware supports. Therefore, setting the DesiredAccuracy property 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.

When neither DesiredAccuracyInMeters nor DesiredAccuracy are set, your app will use an accuracy setting of 500 meters (which corresponds to the DesiredAccuracy setting of Default). Setting DesiredAccuracy to Default or High indirectly sets DesiredAccuracyInMeters to 500 or 10 meters, respectively. When your app sets both DesiredAccuracy and DesiredAccuracyInMeters, your app will use whichever accuracy value was set last.