简体   繁体   English

在Mapkit中检查用户位置年龄-MapKit用户位置的GPS精度明显优于CLLocationManager?

[英]Check user location age in Mapkit - GPS accuracy for MapKit User Location significantly better than from CLLocationManager?

Indoors on an iPhone 4. WiFi disabled 在室内使用iPhone4。禁用WiFi

Running the LocateMe SDK sample or my own code for 30-60 seconds produces horizontal accuracy of 2294 meters. 将LocateMe SDK示例或我自己的代码运行30-60秒将产生2294米的水平精度。 Pretty inaccurate but reasonable for cell tower triangulation. 相当不准确,但对于蜂窝塔三角测量是合理的。 Looking at other apps that do reverse geocoding or location stuff like Foursquare shows a similar lack of accuracy. 查看其他执行反向地理编码或位置信息(例如Foursquare)的应用程序,同样也缺乏准确性。

However, if I switch over to another view in my app that uses Mapkit and check/display the user location it is spot on. 但是,如果我切换到使用Mapkit的应用程序中的另一个视图,并检查/显示其所在的用户位置。 I mean to the house level accurate on the map which I would associate with WiFi level location or a strong GPS read. 我的意思是在地图上准确显示房屋级别,将其与WiFi级别位置或强大的GPS读数相关联。

So I figured that Mapkit is likely relying on a cached location read that was derived when WiFi was enabled on my device. 因此,我认为Mapkit可能依赖于在设备上启用WiFi时派生的缓存位置读取。 I turned off location services in settings. 我在设置中关闭了位置服务。 Restarted the Map app moved the map away from my current location. 重新启动地图应用,将地图从当前位置移开。 Exit Re-enabled location services. 退出重新启用的位置服务。 Open Map app again - bingo right back with the strong location read. 再次打开“地图”应用-宾果游戏立即返回,并显示强力位置。

As far as I know the Location Service is system level singleton meaning the same data is shared with MapKit as with my CLLocationManager instance. 据我所知,定位服务是系统级单例,这意味着与MapKit共享的数据与与CLLocationManager实例共享的数据相同。 The only thing I can think of is the location is being cached more liberally on MapKit and turning off location services doesn't clear it's cache even when map.app is started. 我能想到的唯一一件事是,在MapKit上更自由地缓存了位置,即使启动map.app,关闭位置服务也无法清除它的缓存。

Is anyone aware of a way to check the age of the user location in MapKit? 有人知道在MapKit中检查用户位置年龄的方法吗? I'd like to investigate further and even if it's an undocumented call or property I can't ship with I'd really like to use it for debugging to understand what is going on. 我想进一步调查,即使它是我无法提供的未记录的调用或属性,我也很想将其用于调试以了解正在发生的情况。

Thanks 谢谢

You can access the timestamp of the user's location used by a MKMapView as follows: 您可以按以下方式访问MKMapView使用的用户位置的时间戳:

[[[mapView userLocation] location] timestamp];

The timestamp is an NSDate and it tells you when this location was determined. 时间戳是NSDate ,它告诉您何时确定此位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM