Geolocator.PositionChanged | positionchanged event

Applies to Windows and Windows Phone

Raised when the location is updated.

Syntax


function onPositionChanged(eventArgs) { /* Your code */ }
 
// addEventListener syntax
geolocator.addEventListener("positionchanged", onPositionChanged);
geolocator.removeEventListener("positionchanged", onPositionChanged);
 
- or -

geolocator.onpositionchanged = onPositionChanged;


Event information

Delegate TypedEventHandler<Geolocator, PositionChangedEventArgs>

Remarks

The first use of the Geolocator object to subscribe to PositionChanged events must be made on the UI thread so that the consent prompt can be shown to the user. For more information, see Guidelines for devices that access personal data.

You can access information about the event with the PositionChangedEventArgs object that is passed to your event handler.

When in Connected Standby, Geolocator objects can always be instantiated but the Geolocator object will not find any sensors to aggregate and calls to GetGeopositionAsync will time out after 7 seconds, PositionChanged event listeners will never be called, and StatusChanged event listeners will be called once with the NoData status.

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
PositionChangedEventArgs

 

 

Show:
© 2014 Microsoft. All rights reserved.