-api-id | -api-type |
---|---|
P:Windows.Devices.Geolocation.Geolocator.DesiredAccuracy |
winrt property |
The accuracy level at which the Geolocator provides location updates.
The accuracy level at which the Geolocator provides location updates.
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.
The following example shows how to set the desired accuracy.
Geolocator geolocator = new Geolocator();
geolocator.DesiredAccuracy = Windows.Devices.Geolocation.PositionAccuracy.Default;
geolocator.DesiredAccuracy = Windows.Devices.Geolocation.PositionAccuracy.High;
location ID_CAP_LOCATION [Windows Phone]