Replace icon pin by text label in annotation?
问题 Is it possible to replace the pin icon of an annotation by a dynamic text label? Maybe using css, or dynamically creating an image? For example a label is done with CSS on Google Maps API with JavaScript. 回答1: Yes, it's possible. In iOS MapKit, you'll need to implement the viewForAnnotation delegate method and return an MKAnnotationView with a UILabel added to it. For example: -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation { if ([annotation