removeMapDataStore method

Future<void> removeMapDataStore(
  1. double minLatitude,
  2. double minLongitude,
  3. double maxLatitude,
  4. double maxLongitude,
)

Implementation

Future<void> removeMapDataStore(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude) async {
  BoundingBox toRemove = BoundingBox(minLatitude, minLongitude, maxLatitude, maxLongitude);
  this.boundingBox = null;
  for (Datastore datastore in List.from(mapDatabases)) {
    BoundingBox boundingBox = await datastore.getBoundingBox();
    if (toRemove.intersects(boundingBox)) {
      mapDatabases.remove(datastore);
    } else {
      if (null == this.boundingBox) {
        this.boundingBox = boundingBox;
      } else {
        this.boundingBox = this.boundingBox!.extendBoundingBox(boundingBox);
      }
    }
  }
}