I'm using the new Windows Phone 8 Maps and the Maps Toolkit. On each PositionChanged
event, I set the UserLocationMarker
to the new position. If the user taps on the UserLocationMarker
, I will show the map location via ReverseGeocodeQuery
and set the user location Pushpin to visible. To do this really fast, I execute the ReverseGeocodeQuery
in the PositionChanged
event.
My question is, if the users location changed very quickly, it will execute many ReverseGeocodeQuery
s. Is this a performance issue?
private void InitializeGeolocator()
{
geolocator = new Geolocator();
geolocator.DesiredAccuracy = PositionAccuracy.High;
geolocator.MovementThreshold = 5;
geolocator.StatusChanged += geolocator_StatusChanged;
geolocator.PositionChanged += geolocator_PositionChanged;
}
private void geolocator_PositionChanged(Geolocator sender, PositionChangedEventArgs args)
{
Dispatcher.BeginInvoke(() =>
{
Geoposition geoposition = args.Position;
this.UserLocationMarker.GeoCoordinate = geoposition.Coordinate.ToGeoCoordinate();
this.UserLocationMarker.Visibility = System.Windows.Visibility.Visible;
// execute ReverseGeocodeQuery...
// set Pushpin
});
}
private void userLocationMarker_tap(object sender, GestureEventArgs e)
{
// show user location pushpin...
UserLocationPushpin.Visibility = Visibility.Visible;
}