在 Mapkit 中检查用户位置年龄 - MapKit 用户位置的 GPS 精度明显优于 CLLocationManager?
在室内使用 iPhone 4。 WiFi 禁用
运行 LocateMe SDK 示例或我自己的代码 30-60 秒可产生 2294 米的水平精度。非常不准确,但对于手机塔三角测量来说是合理的。看看其他进行反向地理编码或定位功能(例如 Foursquare)的应用程序,也显示出类似的准确性缺乏。
但是,如果我切换到应用程序中使用 Mapkit 的另一个视图并检查/显示用户位置,那么它就正确了。我的意思是地图上准确的房屋水平,我会将其与 WiFi 水平位置或强大的 GPS 读数相关联。
所以我认为 Mapkit 可能依赖于在我的设备上启用 WiFi 时导出的缓存位置读取。我在设置中关闭了定位服务。重新启动地图应用程序将地图从我当前的位置移开。退出重新启用位置服务。再次打开地图应用程序 - 宾果游戏立即返回,读取强大的位置。
据我所知,位置服务是系统级单例,这意味着与我的 CLLocationManager 实例共享相同的数据。我唯一能想到的是,位置在 MapKit 上被更自由地缓存,并且关闭位置服务并不会清除它的缓存,即使在 map.app 启动时也是如此。
有谁知道在 MapKit 中检查用户位置年龄的方法吗?我想进一步调查,即使这是一个未记录的调用或财产,我无法运送,我真的很想用它来调试以了解发生了什么。
谢谢
Indoors on an iPhone 4.
WiFi disabled
Running the LocateMe SDK sample or my own code for 30-60 seconds produces horizontal accuracy of 2294 meters. 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.
However, if I switch over to another view in my app that uses Mapkit and check/display the user location it is spot on. I mean to the house level accurate on the map which I would associate with WiFi level location or a strong GPS read.
So I figured that Mapkit is likely relying on a cached location read that was derived when WiFi was enabled on my device. 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. 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.
Is anyone aware of a way to check the age of the user location in 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以访问
MKMapView
使用的用户位置的时间戳,如下所示:时间戳是一个
NSDate
,它告诉您何时确定该位置。You can access the timestamp of the user's location used by a
MKMapView
as follows:The timestamp is an
NSDate
and it tells you when this location was determined.