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 *) ...@@ -118,16 +118,20 @@ RCT_EXPORT_METHOD(animateTo:(nonnull NSNumber *)reactTag params:(NSDictionary *)
} }
- (void)mapView:(MAMapView *)mapView didSelectAnnotationView:(MAAnnotationView *)view { - (void)mapView:(MAMapView *)mapView didSelectAnnotationView:(MAAnnotationView *)view {
AMapMarker *marker = (AMapMarker *) view.annotation; if ([view.annotation isKindOfClass:[AMapMarker class]]) {
if (marker.onPress) { AMapMarker *marker = (AMapMarker *) view.annotation;
marker.onPress(@{}); if (marker.onPress) {
marker.onPress(@{});
}
} }
} }
- (void)mapView:(MAMapView *)mapView didAnnotationViewCalloutTapped:(MAAnnotationView *)view { - (void)mapView:(MAMapView *)mapView didAnnotationViewCalloutTapped:(MAAnnotationView *)view {
AMapMarker *marker = (AMapMarker *) view.annotation; if ([view.annotation isKindOfClass:[AMapMarker class]]) {
if (marker.onInfoWindowPress) { AMapMarker *marker = (AMapMarker *) view.annotation;
marker.onInfoWindowPress(@{}); 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