selectedLevelId property

String? get selectedLevelId

The ID of the selected level, or null if no level is selected.

Set this to an existing level ID to select that level. Set the id to null to clear the level selection. On a map, clearing the selection shows levels with vertical order 0. On a scene, it shows all levels. Setting a non-null ID throws an ArcGISException if the FloorManager is not loaded or the ID does not exist.

Implementation

String? get selectedLevelId => _selectedLevel?.levelId;
set selectedLevelId (String? selectedLevelId)

Implementation

set selectedLevelId(String? selectedLevelId) {
  if (_floorManager?.loadStatus != .loaded) {
    throw Exception('FloorManager does not exist or failed to load.');
  }

  if (selectedLevelId == null) {
    _selectLevel(null);
  } else {
    final selectedLevel = _floorManager!.levels.firstWhere(
      (level) => level.levelId == selectedLevelId,
      orElse: () =>
          throw Exception('Level with ID: $selectedLevelId cannot be found.'),
    );
    _selectLevel(selectedLevel);
  }
}