Commit e5b831fa authored by Qiu Xiang's avatar Qiu Xiang

修正 iOS location annotationView 点击崩溃的 bug

parent 057e10ae
......@@ -118,16 +118,20 @@ RCT_EXPORT_METHOD(animateTo:(nonnull NSNumber *)reactTag params:(NSDictionary *)
}
- (void)mapView:(MAMapView *)mapView didSelectAnnotationView:(MAAnnotationView *)view {
AMapMarker *marker = (AMapMarker *) view.annotation;
if (marker.onPress) {
marker.onPress(@{});
if ([view.annotation isKindOfClass:[AMapMarker class]]) {
AMapMarker *marker = (AMapMarker *) view.annotation;
if (marker.onPress) {
marker.onPress(@{});
}
}
}
- (void)mapView:(MAMapView *)mapView didAnnotationViewCalloutTapped:(MAAnnotationView *)view {
AMapMarker *marker = (AMapMarker *) view.annotation;
if (marker.onInfoWindowPress) {
marker.onInfoWindowPress(@{});
if ([view.annotation isKindOfClass:[AMapMarker class]]) {
AMapMarker *marker = (AMapMarker *) view.annotation;
if (marker.onInfoWindowPress) {
marker.onInfoWindowPress(@{});
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment