selectedFacilityId property

String? get selectedFacilityId

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

Set this to an existing facility ID to select that facility.

If the facility has a level with vertical order 0, that level is also selected. If the facility is selected and the facility has a site, that site is also selected.

Set id to null to clear the facility and selected level. Setting a non-null ID throws an ArcGISException if the FloorManager is not loaded or the ID does not exist.

Implementation

String? get selectedFacilityId => _selectedFacility?.facilityId;
set selectedFacilityId (String? selectedFacilityId)

Implementation

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

  if (selectedFacilityId == null) {
    _selectFacility(null);
  } else {
    final selectedFacility = _floorManager!.facilities.firstWhere(
      (facility) => facility.facilityId == selectedFacilityId,
      orElse: () => throw Exception(
        'Facility with ID: $selectedFacilityId cannot be found.',
      ),
    );
    _selectFacility(selectedFacility);
  }
}