FloorFilter

fun FloorFilter(floorFilterState: FloorFilterState, modifier: Modifier = Modifier)

Displays a control for the user to pick which level of a floor aware GeoModel to display.

The simplest workflow is for the app to instantiate a FloorFilter using an instance of the FloorFilterState to ideally display it within the GeoView. The Modifier properties of Box,Column or Row could be used to position the FloorFilter inside of a Composable Map.

Workflow example:

val mapViewModel = viewModel<MapViewModel>(factory = MapViewModelFactory(floorAwareWebMap))
ComposableMap(
modifier = Modifier.fillMaxSize(),
mapInterface = mapViewModel
) {
Box(
modifier = Modifier.fillMaxSize().padding(horizontal = 20.dp, vertical = 40.dp),
contentAlignment = Alignment.BottomStart
) {
FloorFilter(floorFilterState = mapViewModel.floorFilterState)
}
}

Optionally, the default UI settings of the FloorFilter may be overridden by modifying UIProperties defined in the FloorFilterState. The UIProperties enable the customization of the colors, visibility, typography, and more.

Workflow example:

// in the MapViewModel
private val uiProperties = UIProperties().apply {
selectedForegroundColor = Color.Red
typography = MaterialTheme.typography
maxDisplayLevels = 2
closeButtonPosition = ButtonPosition.Bottom
}
// create the floor filter state
val floorFilterState = FloorFilterState(geoModel, coroutineScope, uiProperties)

// pass the floor filter state in the compose layout
FloorFilter(floorFilterState = mapViewModel.floorFilterState)

Since

200.2.0