MKPolygon性能问题

发布于 2024-09-15 17:36:50 字数 203 浏览 1 评论 0原文

我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

音栖息无 2024-09-22 17:36:50

这是苹果公司已知但不太可能改变的问题。基本上,无论您的硬件是什么,除了几个 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.

清泪尽 2024-09-22 17:36:50

我会考虑减少多边形中的点数。取决于你从哪里得到它。大多数地理空间操作数据都具有允许您减少多边形中的点数的功能。 (您所需要做的就是提供准确的测量结果。)

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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文