我可以重新定位已放置在 MKMapView 上的 MKAnnotationView 吗?
每隔几秒钟,我就会检索一个正在运动的现实世界物体的更新后的经纬度。该对象在我的 MKMapView 上由 MKAnnotationView 表示。
是否可以平滑地为对象从一个坐标到另一个坐标的移动设置动画,而不是删除其当前的 MKAnnotationView 并在新坐标处添加一个新的?
理论上我可以想到几种方法,但我只是没有能力在这个可爱的周六结束之前实施它们。所以我对任何方法都很好,无论多么老套,我可能只是需要一点帮助。
预先感谢您的任何帮助! :D
Every few seconds I'm retrieving an updated lat and lon for a real-world object that is in motion. This object is represented on my MKMapView by an MKAnnotationView.
Is it possible to smoothly animate the object's movement from coordinate to coordinate, rather than remove its current MKAnnotationView and add a new one at the new coordinate?
I can think of several approaches in theory, I just don't have the chops to implement them by the end of this lovely Saturday. So I am fine with any approach, however hacky, I just might need a bit of hand holding.
Thanks in advance for any help! :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能值得一试...您是否已将
setCooperative:
添加到相关注释对象并将annotationView 设置为允许拖动?如果是这样,您可以以编程方式设置坐标并更新它吗?Might be worth a try...have you added the
setCoordinate:
to the related annotation object and set the annotationView to allow dragging? If so, can you programatically set the coordinate and update it?