supportsTile method

  1. @override
Future<bool> supportsTile(
  1. Tile tile
)

Checks if the datastore contains data for the specified tile.

tile The tile to check for data availability Returns true if tile data is available, false otherwise

Implementation

@override
Future<bool> supportsTile(Tile tile) async {
  List<Future<bool>> futures = [];
  for (Datastore mdb in List.from(datastores)) {
    futures.add(() async {
      if (_datastoreIntersectsTile(mdb, tile)) {
        return await mdb.supportsTile(tile);
      }
      return false;
    }());
  }
  List<bool> results = await Future.wait(futures);
  for (bool result in results) {
    if (result) {
      return true;
    }
  }
  return false;
}