readLabelsSingle method
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:
Projection projection =
MercatorProjection.fromZoomlevel(tile.zoomLevel);
for (MapDataStore mdb in mapDatabases) {
if (mdb.supportsTile(tile, projection)) {
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");
}