package com.casic.detector.cluster;

import com.amap.api.maps.model.Marker;
import com.amap.api.maps.model.animation.Animation;

import java.util.List;

/**
 * marker渐变动画，动画结束后将Marker删除
 */
public class RemoveAnimationListener implements Animation.AnimationListener {
    private final List<Marker> removeMarkers;

    public RemoveAnimationListener(List<Marker> removeMarkers) {
        this.removeMarkers = removeMarkers;
    }

    @Override
    public void onAnimationStart() {

    }

    @Override
    public void onAnimationEnd() {
        for (Marker marker : removeMarkers) {
            marker.remove();
        }
        removeMarkers.clear();
    }
}