有没有办法在c#windows phone 8应用程序的简单地图上显示我当前位置的坐标?
这是我用来获取当前位置的代码。目前它只显示textblock中的坐标,但我需要将其转换为地图上的显示位置。
private async void GetCurrentLocation()
{
Geolocator locationFinder = new Geolocator();
try
{
Geoposition currentLocation = await locationFinder.GetGeopositionAsync(
maximumAge: TimeSpan.FromSeconds(120),
timeout: TimeSpan.FromSeconds(10));
String longitude = currentLocation.Coordinate.Longitude.ToString("0.00");
String latitude = currentLocation.Coordinate.Latitude.ToString("0.00");
MyTextBlock.Text = "Long: " + longitude + "Lat: " + latitude;
}
catch (UnauthorizedAccessException)
{
MessageBox.Show("And exception occured!");
}
}
感谢任何帮助!谢谢!