switchFloor

open fun switchFloor(targetFloorId: Int, @NonNull listeners: List<MapSelectionChangeListener>): Boolean

Set current floorId and set layer visible. This function is all you need to switch to a floor. Materializes native layers for the target floor if they were deferred.

Parameters

targetFloorId

The floor id for the floor you want to select.


open fun switchFloor(targetFloorId: Int, @NonNull listeners: List<MapSelectionChangeListener>, @Nullable onSwitched: Consumer<Boolean>): Boolean

Same as switchFloor but notifies onSwitched once the target floor is actually visible (its native layers materialized for a deferred floor). Callers that must plot onto the target floor's layers (e.g. a POI pin/selection on a cross-floor select) need this so they run AFTER the floor's pin/entity layers exist — otherwise on the first switch to a deferred floor the plot lands on null layers and is silently dropped.

Parameters

onSwitched

invoked on the main thread with true when the target floor is the current visible floor (including the already-on-floor no-op case), or false if the switch could not be applied. May be null.