【问题标题】:Current location issue with 3G/4G network in Windows 8.1 Store apps?Windows 8.1 应用商店应用中 3G/4G 网络的当前位置问题?
【发布时间】:2016-08-11 05:57:28
【问题描述】:

我使用 C# 开发了一个 Windows 8.1 应用商店应用程序,我想检测用户的当前位置。当我连接到 Wi-Fi 时,我获得了完美的位置,但是当我连接到 3G/4G 网络时,我根本无法获得当前位置,或者有时它会在位置附近给出。我正在使用以下代码来检测当前位置

geolocator = new Geolocator();
geolocator.DesiredAccuracy = PositionAccuracy.High;
geolocator.DesiredAccuracyInMeters = 1000;
geolocator.MovementThreshold = 100;

//geolocator.ReportInterval = 500;
try
{
    Geoposition mygeoPosition = await geolocator.GetGeopositionAsync();
}
catch(UnauthorizedAccessException ex)
{
    UserMessageUtil.ShowMessage("Location is disabled in Settings");
    await Launcher.LaunchUriAsync(new Uri("ms-settings-location:"));
}
catch(Exception ex)
{
    UserMessageUtil.ShowMessage("We are sorry, location services are unavailable.");
}
geolocator.PositionChanged += geolocator_PositionChanged;

有人可以建议,我做错了什么吗?有没有其他应用可以让我通过 3G/4G 网络查看当前位置?

【问题讨论】:

    标签: c# windows-8.1 bing-maps windows-8.1-universal


    【解决方案1】:

    这是意料之中的,因为位置精度会因计算位置的方法而异。以下是大多数常见消费设备中使用的定位方法的准确性(有些商业设备更准确,但大多数手机并未使用):

    • GPS:5 米 - 15 米
    • WI-FI 三角测量:10 米 - 350 米
    • 手机塔三角测量:40米-5公里
    • IP 地址地理编码:如果不在私人或移动设备上,则在 50 公里内 网络。

    如您所见,当依靠 3G/4G 来检测您的位置时,在某些情况下最多可以偏离 5KM。

    【讨论】:

    • 它在移动设备上运行良好,但在平板电脑上它可以提供附近的位置,即使平板设备有 GPS。
    • 如果您在建筑物中,GPS 通常无法工作,并且地理定位器会退回到不太准确的方式来查找您的位置。
    猜你喜欢
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多