C# Windows Phone 8地理定位器在emulator上返回假位置
我已尝试在xaml windows phone 8应用程序中显示我的位置。但当我试图找到我的当前位置时,我总是会得到假的microsoft位置,即使是使用默认的“地图”应用程序。例如,上述代码始终返回相同的纬度和经度:C# Windows Phone 8地理定位器在emulator上返回假位置,c#,windows-phone,windows-phone-8,windows-phone-8-emulator,C#,Windows Phone,Windows Phone 8,Windows Phone 8 Emulator,我已尝试在xaml windows phone 8应用程序中显示我的位置。但当我试图找到我的当前位置时,我总是会得到假的microsoft位置,即使是使用默认的“地图”应用程序。例如,上述代码始终返回相同的纬度和经度: Geolocator locator = new Geolocator(); locator.DesiredAccuracy = PositionAccuracy.High; Geoposition position = await locator.GetGeopositionA
Geolocator locator = new Geolocator();
locator.DesiredAccuracy = PositionAccuracy.High;
Geoposition position = await locator.GetGeopositionAsync();
LatitudeValue.Text = position.Coordinate.Latitude.ToString("0.00");
LongitudeValue.Text = position.Coordinate.Longitude.ToString("0.00");
WindowsPhone8模拟器在右上角有一个小工具栏。底部按钮是一个双V形(如“>>”)-如果单击它,将显示“其他工具”,其中一个选项卡是“位置”。您可以双击地图在模拟器中设置您的位置,还可以录制和播放旅行路线。模拟器总是返回一个假位置。正如gregstoll提到的,您可以控制它应该报告哪个“假”位置。使用内置API无法获得真实位置。如果我向地图添加图钉,然后调用
await locator.GetGeopositionAsync();
它总是返回Microsoft的坐标(47.643318,-122.141937),无论我选择的是当前位置
它看起来像一只虫子,还是我遗漏了什么?是否有其他人遇到此问题?关于Microsoft HQ位置错误,有一个解决方法 如果设置:
geoLocator = new Geolocator
{
DesiredAccuracy = PositionAccuracy.High
};
它将显示您在emulator附加工具中设置的位置。似乎有解决办法。但是它不能与几个职位更新一起工作,谢谢你的解决方案!它使用手机的本地地图应用程序工作。