Skip to content

Commit

Permalink
unmanaged descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
siokstoksanoks committed Jan 22, 2019
1 parent 767c2ba commit bf3c0b4
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void render(@NonNull List<Cluster<T>> clusters) {
animateMarkerToLocation(markerToRemove, new LatLng(parentCluster.getLatitude(),
parentCluster.getLongitude()), true);
} else {
markerToRemove.remove();
removeMarker(markerToRemove);
}

mMarkers.remove(clusterToRemove);
Expand Down Expand Up @@ -144,6 +144,18 @@ void render(@NonNull List<Cluster<T>> clusters) {
}
}

void removeMarker(Marker marker) {
if (null == marker) {
return;
}

try {
marker.remove();
} catch (Exception e) {
e.printStackTrace();
}
}

@NonNull
private BitmapDescriptor getMarkerIcon(@NonNull Cluster<T> cluster) {
BitmapDescriptor clusterIcon;
Expand Down Expand Up @@ -199,7 +211,7 @@ private void animateMarkerToLocation(@NonNull final Marker marker, @NonNull LatL
@Override
public void onAnimationEnd(Animator animation) {
if (removeAfter) {
marker.remove();
removeMarker(marker);
}
}
});
Expand Down

0 comments on commit bf3c0b4

Please sign in to comment.