removeDatastore method
Implementation
Future<void> removeDatastore(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude) async {
BoundingBox toRemove = BoundingBox(minLatitude, minLongitude, maxLatitude, maxLongitude);
_boundingBox = null;
for (Datastore datastore in List.from(datastores)) {
BoundingBox? datastoreBoundary = _datastoreBoundaries[datastore];
datastoreBoundary ??= await datastore.getBoundingBox();
if (toRemove.intersects(datastoreBoundary)) {
datastores.remove(datastore);
_datastoreBoundaries.remove(datastore);
} else {
if (null == _boundingBox) {
_boundingBox = datastoreBoundary;
} else {
_boundingBox = _boundingBox!.extendBoundingBox(datastoreBoundary);
}
}
}
}