Created
June 25, 2012 06:08
-
-
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 )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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