loadIndoorMap method

Future<void> loadIndoorMap(
  1. String venueId, {
  2. int initialFloor = 0,
  3. bool fitBounds = true,
  4. bool animate = true,
})

Load a venue and switch map filtering to its initial floor.

Implementation

Future<void> loadIndoorMap(String venueId, {int initialFloor = 0, bool fitBounds = true, bool animate = true}) async {
  _currentVenueId = venueId;
  final venueInfo = await getVenueInfo(venueId);

  // Fallback if the requested floor is not in the venue's available floors
  int targetFloor = initialFloor;
  if (venueInfo != null && venueInfo['floors'] != null) {
    final List<int> floors = venueInfo['floors'];
    if (floors.isNotEmpty && !floors.contains(targetFloor)) {
      targetFloor = floors.first;
    }
  }

  await setFloor(targetFloor, animate: animate);

  // Optional: Fit bounds logic can be implemented here if the SDK has a unified bounding box computation
  // if (fitBounds && venueInfo != null && venueInfo['geometry'] != null) {
  //   // TODO: Add fit bounds to venue geometry
  // }
}