是否可以确定使用的Geolocation方法? [英] Is it possible to determine the Geolocation method used?

查看:116
本文介绍了是否可以确定使用的Geolocation方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CLLocationManager在我的应用中获取位置更新。有没有办法确定GeoLocation方法是什么?例如。 GPS,三角测量,IP(网络)。

I am using CLLocationManager to get location updates in my app. Is there a way to determine what the GeoLocation method was? E.g. GPS, Triangulation, IP (Network).

推荐答案

不是真的。您可以查看CLLocation对象的 horizo​​ntalAccuracy ,并根据其值进行猜测:

Not really. You can take a look at the horizontalAccuracy of a CLLocation object and hazard a guess based on its value, though:


  • < 25米:可能是GPS

  • < 200米:可能是Wi-Fi

  • 更大的东西:可能是细胞塔三角测量

这些价值只是我的头脑 - 最准确你自己可能想做一些实验。

These values are just off the top of my head—to be most accurate you’ll probably want to do some experimentation yourself.

编辑 - 值得注意的是确定设备您正在运行可以为您提供有关正在使用的位置提供程序的更多信息。例如,第一代iPhone没有GPS,所以如果你在其中一个上运行,那么你的位置肯定来自手机信号塔或Wi-Fi;迄今为止,没有任何iPod型号支持Wi-Fi三角测量以外的任何功能;只有iPad的3G型号曾经有过手机三角测量和GPS。

edit - also worth noting is that determining the device you’re running on can give you more information about which location provider is being used. For instance, first-gen iPhones had no GPS, so if you’re running on one of those then your location is definitely coming from either cell towers or Wi-Fi; no iPod model to date has supported anything other than Wi-Fi triangulation; and only the 3G model of the iPad has ever had cell-tower triangulation and GPS.

这篇关于是否可以确定使用的Geolocation方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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