getRoomIndex method
override
Fetches searchable room metadata without requesting polygon coordinates.
layerNames must come from getLayers. Requests are batched and completed
sequentially to bound URL length and pressure on the campus server.
Layers explicitly reported to have no backing schema contribute no rooms;
failed or malformed responses from all other layers abort the index.
Implementation
@override
Future<List<CampusMapRoomDto>> getRoomIndex(List<String> layerNames) async {
for (final layer in layerNames) {
_validateLayer(layer);
}
final rooms = <CampusMapRoomDto>[];
const batchSize = 25;
for (var start = 0; start < layerNames.length; start += batchSize) {
final batch = layerNames.sublist(
start,
min(start + batchSize, layerNames.length),
);
final remaining = List<String>.of(batch);
while (remaining.isNotEmpty) {
try {
rooms.addAll(
await compute(
parseCampusMapRooms,
await _features(remaining, metadataOnly: true),
),
);
break;
} on _UnavailableLayer catch (error) {
remaining.remove(error.name);
}
}
}
return rooms;
}