如何评估 GPS 信号强度?(iPhone)

How can I evaluate the GPS signal strength? (iPhone)(如何评估 GPS 信号强度?(iPhone))

本文介绍了如何评估 GPS 信号强度?(iPhone)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种对 GPS 信号强度进行分类的方法.到目前为止,我遇到了 CLLocationhorizo​​ntalAccuracy 属性(类参考).

I need a way of categorising the strength of the GPS signal. So far I have come across the horizontalAccuracy property of CLLocation (Class Reference).

更具体地说,我需要创建如下内容;我遇到的问题是填写 if 语句.

To be more specific I need to create something like the following; the issue I'm having is filling in the if statements.

if (someLocation.horizontalAccuracy ...)
{
    // No Signal
}
else if (someLocation.horizontalAccuracy ...)
{
    // Poor Signal
}
else if (someLocation.horizontalAccuracy ...)
{
    // Average Signal
}
else if (someLocation.horizontalAccuracy ...)
{
    // Good Signal
}
else
{
    // Excellent Signal
}

请问有人可以帮我吗?

推荐答案

我以前用过这样的图:

if (someLocation.horizontalAccuracy < 0)
{
    // No Signal
}
else if (someLocation.horizontalAccuracy > 163)
{
    // Poor Signal
}
else if (someLocation.horizontalAccuracy > 48)
{
    // Average Signal
}
else
{
    // Full Signal
}

但老实说,它对用户来说并不是很有效.它会显示为低准确度,但当他们查看地图应用程序时,它会几乎完美地定位它们(​​尽管它们周围有一个圆圈).

but to be honest, it didn't really work very well for users. It would show as low accuracy, but when they looked at the maps app, it would have located them almost perfectly (albeit with a circle around them).

与其尝试定义准确度级别,而且如果您的应用是基于地图的,您能否像地图一样将水平准确度显示为圆形叠加层?然后用户可以自己决定它是否足够准确.

Rather than trying to define a level of accuracy, and if your app is map based, could you do what Maps does and show the horizontal accuracy as an circular overlay? Then the user can decide for themselves if it's accurate enough.

这篇关于如何评估 GPS 信号强度?(iPhone)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何评估 GPS 信号强度?(iPhone)

基础教程推荐