在 iPhone 中通过代码显示地图标注
我尝试了几件事但无法解决。
我在地图上有 10 个自定义注释,具体取决于可见区域。
现在我有下一个和上一个两个按钮。单击必须显示注释标注。
即,如果我单击“下一个”按钮,则会出现注释 1 的标注,当我再次单击“下一步”时,第一个标注将隐藏,第二个标注将出现。
我已经尝试过
[self.mapView selectAnnotation:self.nextSelectedAnnotationView.annotation animated:YES]
,
[self.mapView deselectAnnotation:self.selectedAnnotationView.annotation animated:YES];
但主要问题是如何在这里获取注释?
我已尝试 NSArray* selectedAnnotations=self.mapview.annotations
来获取注释数组
id annotationView =[selectedAnnotations objectAtIndex:i];
[self.mapView selectAnnotation:annotationView animated:YES];
,但没有运气:(
还有其他方法来解决我的问题吗??
I have tried several things but am unable to solve it out.
I have 10 custom annotations on the map depending upon the area visible.
Now I have 2 buttons next and previous. Clicking on which the callout of annotation must get displayed.
i.e if i click on next buton then callout of annotation 1 will appear and when i click next again then the callout of first will hide and callout of second will appear.
I have tried out
[self.mapView selectAnnotation:self.nextSelectedAnnotationView.annotation animated:YES]
and
[self.mapView deselectAnnotation:self.selectedAnnotationView.annotation animated:YES];
But the main problem is how to get the annotation here??
I have tried NSArray* selectedAnnotations=self.mapview.annotations
to get the annotations array
id annotationView =[selectedAnnotations objectAtIndex:i];
[self.mapView selectAnnotation:annotationView animated:YES];
But no luck :(
Any other way to solve my issue.??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可能会帮助你。
it may help you.