Skip to content

Commit

Permalink
Check for mMapView nil in RCTMGLPointAnnotation removeFromMap
Browse files Browse the repository at this point in the history
  • Loading branch information
mfazekas committed Jun 8, 2020
1 parent f176a08 commit bb7b8d5
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,19 @@ public void addToMap(RCTMGLMapView mapView) {

@Override
public void removeFromMap(RCTMGLMapView mapView) {
RCTMGLMapView map = (mMapView != null) ? mMapView : mapView;
if (map == null) {
return;
}

if (mAnnotation != null) {
mMapView.getSymbolManager().delete(mAnnotation);
map.getSymbolManager().delete(mAnnotation);
}
if (mChildView != null) {
mMapView.offscreenAnnotationViewContainer().removeView(mChildView);
map.offscreenAnnotationViewContainer().removeView(mChildView);
}
if (mCalloutView != null) {
mMapView.offscreenAnnotationViewContainer().removeView(mCalloutView);
map.offscreenAnnotationViewContainer().removeView(mCalloutView);
}
}

Expand Down

0 comments on commit bb7b8d5

Please sign in to comment.