Multiple annotation callouts displaying in MKMapView

后端 未结 3 1235
醉话见心
醉话见心 2020-11-27 23:05

Is it possible to open simultaneously more then one callout?

The code:

- (void)mapViewDidFinishLoadingMap:(MKMapView *)theMapView {
    for (id

        
3条回答
  •  温柔的废话
    2020-11-27 23:28

    Note that there is a method on MKMapView (not MKAnnotationView) for selecting an annotation programmatically that works more or less as you would expect:

    - (void)selectAnnotation:(id < MKAnnotation >)annotation animated:(BOOL)animated
    

    However, it automatically deselects any currently annotation at the same time so this doesn't solve your problem.

    Oddly, there is a property on MKMapView that appears to hold an array of currently selected annotations:

    @property(nonatomic, copy) NSArray *selectedAnnotations
    

    But the documentation on this method says:

    "Assigning a new array to this property selects the first annotation in the array only."

    Just thought this might be of interest.

提交回复
热议问题