iphone:在 MKMapView 上绘图?

发布于 2024-08-09 07:36:32 字数 212 浏览 5 评论 0原文

我正在尝试在地图视图上绘制多边形。我所做的是在主视图上添加一个透明视图,该视图与 mapView 的边界相匹配,然后在它上面进行绘制。当我移动桌子时,它没问题,但是当我放大和缩小多边形时,多边形在 Y 轴(纬度)上“反弹”,但 x 轴却没问题。你怎么认为?

顺便说一句,我尝试将透明视图作为子视图添加到地图视图中,但随后它搞砸了用户交互。

这怎么能做到呢?如有帮助,将不胜感激。

I'm attempting to draw polygons on a mapView. What I did was to add a transparent view on the main view, that matches the bounds of the mapView, and I draw over it. When I move the table it's ok, but when I zoom in and out the polygones 'bounce' on the Y axis (latitude) but the x axis is ok. What do you think?

BTW I tried to add the transparent view as a subview to the mapView but then it screwed up the user interactions.

How can this be done? Help would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

水染的天色ゝ 2024-08-16 07:36:32

看看这篇文章。它有点旧但仍然有效。他展示了如何在 MKMapView 上绘制路线,这与此类似。

该帖子是:http://spitzkoff.com/craig/?p=65

Check out this post. It's a little old but still works. He shows how to draw a route over a MKMapView, which is similar.

The post is: http://spitzkoff.com/craig/?p=65

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