Skip to content

Instantly share code, notes, and snippets.

@anuith
Created June 25, 2012 06:08
Show Gist options
  • Save anuith/2986924 to your computer and use it in GitHub Desktop.
Save anuith/2986924 to your computer and use it in GitHub Desktop.
Windows Phone Hackathon : Bing Map Sample - Code - FindMe & ResetMap (Incompleted; continue on: https://gist.github.com/2986930 )
private void FindMe() {
// Reinitialize the GeoCoordinateWatcher
watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
watcher.MovementThreshold = 100;//distance in metres
// Add event handlers for StatusChanged and PositionChanged events
watcher.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(watcher_StatusChanged);
watcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(watcher_PositionChanged);
// Start data acquisition
watcher.Start();
// Disable button
ApplicationBarIconButton ApplicationBarButton_FindMe = ApplicationBar.Buttons[0] as ApplicationBarIconButton;
ApplicationBarButton_FindMe.IsEnabled = false;
}
private void ResetMap() {
Map_Main.SetView(defaultLocation, defaultZoomLevel);
Map_Main.Mode = new RoadMode();
PushPin_Main.Location = defaultLocation;
PushPin_Main.Visibility = System.Windows.Visibility.Collapsed;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment