iphone:在 MKMapView 上绘图?
我正在尝试在地图视图上绘制多边形。我所做的是在主视图上添加一个透明视图,该视图与 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看这篇文章。它有点旧但仍然有效。他展示了如何在 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