readLabelsSingle method

  1. @override
Future<DatastoreReadResult?> readLabelsSingle(
  1. Tile tile
)
override

Reads only labels for tile. Labels are pois as well as ways that carry a name tag. It is permissible for the MapDataStore to return more data. This default implementation returns all map data, which is inefficient, but works.

@param tile tile for which data is requested. @return label data for the tile.

Implementation

@override
Future<DatastoreReadResult?> readLabelsSingle(Tile tile) async {
  switch (this.dataPolicy) {
    case DataPolicy.RETURN_FIRST:
      for (Datastore mdb in mapDatabases) {
        if ((await mdb.supportsTile(tile))) {
          return mdb.readLabelsSingle(tile);
        }
      }
      return null;
    case DataPolicy.RETURN_ALL:
      return _readLabelsDedup(tile, false);
    case DataPolicy.DEDUPLICATE:
      return _readLabelsDedup(tile, true);
  }
  //throw new Exception("Invalid data policy for multi map database");
}