我想在一个特定的缩放级别之后自动显示注释标注。但是,我不想拥有所有的注释标注,而只是那些显示在屏幕上的标注。
发布于 2014-03-31 08:40:15
要显示屏幕上可见的注释标注,只需使用下面的代码即可,因为它依赖于selectAnnotation方法MKMapView,当然,在检测到所需的缩放级别之后:
for (MKAnnotation *annotation in mapView.annotations) {
if ( MKMapRectContainsPoint(mapView.visibleMapRect, MKMapPointForCoordinate(annotation.coordinate)) ) {
[mapView selectAnnotation:annotation animated:YES];
}
}https://stackoverflow.com/questions/22663970
复制相似问题