地图视图上的用户可移动点?
在 MKMapView 上放置一个点(自定义 png)并允许用户在地图上移动该点的最佳方法是什么。此外,当手指松开时,地图应该以点为中心......
有什么技术可以实现这一点吗?
What would be the best way to place a dot (a custom png) on an MKMapView, and allow the user to move the dot around the map. Additionally, when the finger is released, the map should center on the dot...
Are the any techniques which could make this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你应该查看 MKOverlayView 类< /a>,因为这应该可以帮助您绘制自定义 png。
您也许可以子类化此类并重写实例方法
–touchesMoved:withEvent:
、–touchesEnded:withEvent
和–touchesCancelled:withEvent:
来处理用户输入?I think you should check out the MKOverlayView class, as this should help you out with drawing the custom png.
You could perhaps subclass this class and override the instance methods
– touchesMoved:withEvent:
,– touchesEnded:withEvent
and– touchesCancelled:withEvent:
to handle the user input?