getDataTimestamp method
Returns the timestamp of the data used to render a specific tile.
If the tile uses data from multiple data stores, the most recent timestamp is returned.
@param tile A tile. @return the timestamp of the data used to render the tile
Implementation
@override
Future<int?> getDataTimestamp(Tile tile) async {
switch (this.dataPolicy) {
case DataPolicy.RETURN_FIRST:
for (Datastore mdb in mapDatabases) {
if (mdb is MapDataStore && (await mdb.supportsTile(tile))) {
return mdb.getDataTimestamp(tile);
}
}
return 0;
case DataPolicy.RETURN_ALL:
case DataPolicy.DEDUPLICATE:
int result = 0;
for (Datastore mdb in mapDatabases) {
if (mdb is MapDataStore && (await mdb.supportsTile(tile))) {
result = max(result, (await mdb.getDataTimestamp(tile))!);
}
}
return result;
}
//throw new Exception("Invalid data policy for multi map database");
}