Windows Dev Center

PositionStatus enumeration

Indicates the ability of the Geolocator object to provide location data.

Syntax


var value = Windows.Devices.Geolocation.PositionStatus.ready;

Members

The PositionStatus enumeration has these members.

MemberValueDescription
Ready | ready0

Location data is available.

Initializing | initializing1

Location services is initializing. This is the status if a GPS is the source of location data and the GPS receiver does not yet have the required number of satellites in view to obtain an accurate position.

NoData | noData2

No location data is available from any source.

LocationStatus will have this value if the application calls GetGeopositionAsync or registers an event handler for the PositionChanged event, before data is available from a location sensor. Once data is available LocationStatus transitions to the Ready state.

Disabled | disabled3

Location settings are turned off. This status indicates that the user has not granted the application permission to access location.

NotInitialized | notInitialized4

An operation to retrieve location has not yet been initialized. LocationStatus will have this value if the application has not yet called GetGeopositionAsync or registered an event handler for the PositionChanged event. LocationStatus may also have this value if your app doesn’t have permission to access location.

Important  

Starting in Windows 10 Insider Preview, call the RequestAccessAsync before accessing the user’s location. At that time, your app must be in the foreground and RequestAccessAsync must be called from the UI thread. Until the user grants your app permission to their location, your app can't access location data.

NotAvailable | notAvailable5

Location services is not available on this version of Windows.

Remarks

When using a geofence, use the GeofenceMonitor's StatusChanged event to monitor changes in location permissions instead of the StatusChanged event from the Geolocator class. A GeofenceMonitorStatus of Disabled is equivalent to a disabled PositionStatus - both indicate that the app does not have permission to access location.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Capabilities

location
ID_CAP_LOCATION [Windows Phone]

Requirements (Windows 8.x and Windows Phone 8.x)

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]

Attributes

[Version(0x06020000)]

See also

Detect a user's location
Respond to location updates
Set up a geofence
geolocation sample

 

 

Show:
© 2015 Microsoft