Skip to content

Commit

Permalink
fix(android): crash when removing feature belonging to collection (#4707
Browse files Browse the repository at this point in the history
)

Resolves #4706
  • Loading branch information
monholm committed Apr 23, 2023
1 parent d0039d0 commit ae6fe90
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion android/src/main/java/com/rnmaps/maps/MapView.java
Expand Up @@ -770,10 +770,21 @@ public void removeFeatureAt(int index) {
MapFeature feature = features.remove(index);
if (feature instanceof MapMarker) {
markerMap.remove(feature.getFeature());
feature.removeFromMap(markerCollection);
} else if (feature instanceof MapHeatmap) {
heatmapMap.remove(feature.getFeature());
feature.removeFromMap(map);
} else if(feature instanceof MapCircle) {
feature.removeFromMap(circleCollection);
} else if(feature instanceof MapOverlay) {
feature.removeFromMap(groundOverlayCollection);
} else if(feature instanceof MapPolygon) {
feature.removeFromMap(polygonCollection);
} else if(feature instanceof MapPolyline) {
feature.removeFromMap(polylineCollection);
} else {
feature.removeFromMap(map);
}
feature.removeFromMap(map);
}

public WritableMap makeClickEventData(LatLng point) {
Expand Down

0 comments on commit ae6fe90

Please sign in to comment.