     removeOverlay(overlayPolygon)
     
     mapView.removeOverlays(overlays)
-    mapView.removeAnnotations(animatedAnnotations)
     mapView.removeAnnotations(dynamicAnnotations)
+    removeAnnotations(withSameIDsAs: animatedAnnotations)
     
     super.cleanUp(mapView, animated: animated)
   }

}

// MARK: - Updating animated annotations

fileprivate extension Array where Element: MKAnnotation {
  fileprivate var identities: [String] {

      let removed = oldValue.elements(notIn: animatedAnnotations)
      let added = animatedAnnotations.elements(notIn: oldValue)
      mapView.addAnnotations(added)
      removeAnnotations(withSameIDsAs: removed)
    }
  }
  
