qq278360339
 1 switch (e.Status)
 2 {
 3     case GeoPositionStatus.Disabled:
 4         // The location service is disabled or unsupported.
 5         // Alert the user
 6         StatusTextBlock.Text = "location is unsupported on this device";
 7         break;
 8     case GeoPositionStatus.Initializing:
 9         // The location service is initializing.
10         // Disable the Start Location button
11         StatusTextBlock.Text = "initializing location service," + accuracyText;
12         break;
13     case GeoPositionStatus.NoData:
14         // The location service is working, but it cannot get location data
15         // Alert the user and enable the Stop Location button
16         StatusTextBlock.Text = "data unavailable," + accuracyText;
17         break;
18     case GeoPositionStatus.Ready:
19         // The location service is working and is receiving location data
20         // Show the current position and enable the Stop Location button
21         StatusTextBlock.Text = "receiving data, " + accuracyText;
22         break;
23 }
watcher = new GeoCoordinateWatcher(accuracy);
watcher.MovementThreshold = 20;

// 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();

本文转自:卤面网

原文地址:http://www.hugwp.com/thread-722-1.html

源码下载(本地)

分类:

技术点:

相关文章: