我如何评估GPS信号强度? (苹果手机) [英] How can I evaluate the GPS signal strength? (iPhone)

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

问题描述

我需要一种分类GPS信号强度的方法。到目前为止,我遇到了 horizo​​ntalAccuracy 属性 CLLocation Class Reference )。

我需要创建类似以下的东西;我遇到的问题是如果语句填入

  if(someLocation.horizo​​ntalAccuracy ...)
{
//无信号
}
else if(someLocation.horizo​​ntalAccuracy ...)
{
//不好的信号
}
else if(someLocation.horizo​​ntalAccuracy ...)
{
//平均信号
}
else if(someLocation。 horizo​​ntalAccuracy ...)
{
//良好信号
}
else
{
//极好信号
}

请问有人可以帮助我吗?

解决方案

过去我使用过这样的数据:

  if(someLocation.horizo​​ntalAccuracy< 0)
{
//无信号
}
else if(someLocation.horizo​​ntalAccuracy> 163)
{
//信号差
}
else if(someLocation.horizo​​ntalAccuracy> 48)
{
//平均信号
}
else
{
//全信号
}

但说实话,这对用户来说并不是很好。它会表现出低精度,但是当他们查看地图应用程序时,它们几乎可以完美地找到它们(尽管它们周围有一圈)。

与其尝试定义一个准确的级别,如果你的应用是基于地图的,你可以做Maps做什么,并将水平精度显示为圆形覆盖?然后用户可以自己决定是否足够准确。


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).

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
}

Please can someone assist me in this?

解决方案

I've used figures like this in the past:

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信号强度? (苹果手机)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆