本文介绍了什么是CoreLocation的“区域监视"系统定义的缓冲?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用模拟器来测试区域监视.在模拟器中使用CoreLocation进行区域监视和Freeway Drive测试位置路径(调试">位置">"Freeway Drive"),我可以至少在视觉上模拟Freeway Drive与各种叠加层相交时的路径.一旦我开始监视用户的位置,这些叠加层就会转换为区域并受到监视.无论如何,这似乎效果不佳.当您认为"它们时,由我的叠加层表示的区域不会引起didEnter/didExit事件.这些区域的大小似乎比我指定的距离宽得多.我猜这是因为系统需要缓冲.

I'm using the simulator to test region monitoring. Using CoreLocation with region monitoring and the Freeway Drive test location path in the Simulator (Debug > Location > Freeway Drive) I'm able to simulate, at least visually the path of the Freeway Drive as it intersects with various overlays. Those overlays are converted to regions and monitored as soon as I start monitoring the user's location. Anyway, this doesn't seem to work very well. The regions represented by my overlays don't cause didEnter/didExit events when you "think" they would. The regions seem to be much wider in size than the distances I specified. I'm guess this is because of the cushion the system applies.

Apple的区域监视文档指出:

文档似乎并没有确切说明这个缓冲是什么.也不怎么计算.有谁知道系统定义的缓冲是什么?

The docs don't seem to state what this cushion is, exactly. Nor how it is calculated. Does anyone know what the system defined cushion is?

推荐答案

我认为是200m.在区域监视"文档的底部,有一段简短地解释了如何进行测试:

I think it's 200m. At the bottom of the Region Monitoring documentation there's a paragraph that loosely explains how to test:

特定阈值距离由当前可用的硬件和定位技术确定.例如,如果禁用了Wi-Fi,则区域监视的准确性会大大降低. 但是,出于测试目的,您可以假定最小距离约为200米.

The specific threshold distances are determined by the hardware and the location technologies that are currently available. For example, if Wi-Fi is disabled, region monitoring is significantly less accurate. However, for testing purposes, you can assume that the minimum distance is approximately 200 meters.

这篇关于什么是CoreLocation的“区域监视"系统定义的缓冲?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 05:52