Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add Action selector to the popup bubble on Annotation view
    primarykey
    data
    text
    <p>I have very new to MapKit Implementation</p> <p>In my app one page is to be map View</p> <p>in that I have displayed bulk amount of pins and their Annotation actions.</p> <p><strong>I have added a Discloser button on the <em><code>popup bubble</code></em> and set action for these discloser buttons as shown bellow.</strong></p> <p><strong><em><code>i Want to Same action When tap on that gray bubble</code></em></strong></p> <pre><code>//To add a discloser button to show route map UIButton *detailBtn=[UIButton buttonWithType:UIButtonTypeDetailDisclosure]; pinView.rightCalloutAccessoryView=detailBtn; [detailBtn addTarget:self action:@selector(showRoute:) forControlEvents:UIControlEventTouchUpInside]; DisplayMap *ann=(DisplayMap *)annotation; detailBtn.tag = ann.detailButtonTag; //viewForAnnotation DELEGATE for annotions -(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation: (id &lt;MKAnnotation&gt;)annotation { MKPinAnnotationView *pinView = nil; if(annotation != mapView.userLocation) { static NSString *defaultPinID = @"com.invasivecode.pin"; pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID]; if ( pinView == nil ) pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:defaultPinID] ; pinView.pinColor = MKPinAnnotationColorRed; pinView.canShowCallout = YES; pinView.animatesDrop = YES; //To add a discloser button to show route map UIButton *detailBtn=[UIButton buttonWithType:UIButtonTypeDetailDisclosure]; pinView.rightCalloutAccessoryView=detailBtn; [detailBtn addTarget:self action:@selector(showRoute:) forControlEvents:UIControlEventTouchUpInside]; DisplayMap *ann=(DisplayMap *)annotation; detailBtn.tag = ann.detailButtonTag; } else { [mapView.userLocation setTitle:@"I am here"]; } return pinView; } </code></pre> <p>But i Want to Same action When tap on that gray bubble.. </p> <p>how to do it<img src="https://i.stack.imgur.com/dwxAj.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload