MKPolygon性能问题
我使用 MKPolygon 创建了一整堆叠加层,并创建为 MKPolygonView。这工作正常,但其中一个覆盖层有大量点(大约 800 个点)的对接负载,这会导致内存和性能问题。我在 MKPolygonView 上尝试了 shouldRasterize 但这产生了相反的影响,我对此并不感到惊讶。
除了降低分数(我正在做的过程中)之外,我还能做其他什么事情来提高它的性能吗?
I have created a whole heap of overlays using MKPolygon and created into a MKPolygonView. This works fine but one of the overlays has a butt load of points (about 800 points) and this causes memory and performance issues. I tried shouldRasterize on the MKPolygonView but this had the opposite affect which I am not surprised.
Is there any other thing I can do to increase the performance of it besides lowing the amount of points (which I am in the process of doing)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是苹果公司已知但不太可能改变的问题。基本上,无论您的硬件是什么,除了几个 MKOverlayViews 之外,您都会遇到性能问题。您基本上要做的就是子类化 MKPolygonView 并将所有 MKPolygon 合并到一个 MKPolygonView 中。
代码可以在 Apple 论坛上找到,但由于不是我编写的,所以我认为我不应该将其发布在这里。
This is an issue that is known by Apple but unlikely to change. Basically anything more then a couple of MKOverlayViews you will have performance issues no matter what your hardware. What you have to basically do is to subclass MKPolygonView and merge all the MKPolygons into one MKPolygonView.
Code is available on Apple Forums but as I didn't write it I don't think I should post it here.
我会考虑减少多边形中的点数。取决于你从哪里得到它。大多数地理空间操作数据都具有允许您减少多边形中的点数的功能。 (您所需要做的就是提供准确的测量结果。)
I would look at reducing the number of points in the polygon. depending on wher you got it from. Most geopatial manipulation data has functions that will alow you to reduce the number of points in a polygon. (all you need to do is supply an accuracy measurement.)