Display and browse through building floors from a floor-aware web map.

Use case
Having map data to aid indoor navigation in buildings with multiple floors such as airports, museums, or offices can be incredibly useful. For example, you may wish to browse through all available floor maps for an office in order to find the location of an upcoming meeting in advance.
How to use the sample
Use the spinner to browse different floor levels in the facility. Only the selected floor will be displayed.
How it works
- Create a
PortalItemusing theitemIdof the floor-aware web map, and use it to create anArcGISMap. - Create a
FloorFilterState, passing it the map as itsgeoModel, and configure itsUIProperties(e.g.maxDisplayLevels,closeButtonPosition). - Display the map in a
MapView. - Display a
FloorFiltercomposable over theMapView, passing it theFloorFilterState, to let the user browse and switch between the map’s floors.
Relevant API
- FloorManager
About the data
This sample uses a floor-aware web map that displays the floors of Building L on the Esri Redlands campus.
Additional information
This sample uses the FloorFilter toolkit component. For information about setting up the toolkit visit the developer guide doc.
Tags
building, facility, floor, floor-aware, floors, ground floor, indoor, level, site, story, toolkit
Sample code
/* Copyright 2026 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */
package com.esri.arcgismaps.sample.browsebuildingfloors.components
import android.app.Applicationimport androidx.lifecycle.AndroidViewModelimport androidx.lifecycle.viewModelScopeimport com.arcgismaps.mapping.ArcGISMapimport com.arcgismaps.mapping.PortalItemimport com.arcgismaps.portal.Portalimport com.arcgismaps.toolkit.indoors.FloorFilterStateimport com.esri.arcgismaps.sample.sampleslib.components.MessageDialogViewModelimport kotlinx.coroutines.launch
class BrowseBuildingFloorsViewModel(app: Application) : AndroidViewModel(app) {
// Create a portal item using a floor-aware web map. val portalItem = PortalItem( portal = Portal("https://www.arcgis.com/"), itemId = "f133a698536f44c8884ad81f80b6cfc7" )
// Create the map using the portal item val arcGISMap = ArcGISMap(portalItem)
// FloorFilterState to hold the current filter info val floorFilterState = FloorFilterState(geoModel = arcGISMap)
// Create a message dialog view model for handling error messages val messageDialogVM = MessageDialogViewModel()
init { viewModelScope.launch { arcGISMap.load().onFailure { messageDialogVM.showMessageDialog(it) } } }}/* Copyright 2026 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */
package com.esri.arcgismaps.sample.browsebuildingfloors
import android.os.Bundleimport androidx.activity.ComponentActivityimport androidx.activity.compose.setContentimport androidx.activity.enableEdgeToEdgeimport androidx.compose.material3.MaterialThemeimport androidx.compose.material3.Surfaceimport com.esri.arcgismaps.sample.sampleslib.theme.SampleAppThemeimport com.esri.arcgismaps.sample.browsebuildingfloors.screens.BrowseBuildingFloorsScreen
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) enableEdgeToEdge() setContent { SampleAppTheme { Surface(color = MaterialTheme.colorScheme.background) { BrowseBuildingFloorsScreen() } } } }}/* Copyright 2026 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */
package com.esri.arcgismaps.sample.browsebuildingfloors.screens
import androidx.compose.foundation.layout.Boximport androidx.compose.foundation.layout.fillMaxSizeimport androidx.compose.foundation.layout.paddingimport androidx.compose.material3.Scaffoldimport androidx.compose.runtime.Composableimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.res.stringResourceimport androidx.compose.ui.unit.dpimport androidx.lifecycle.viewmodel.compose.viewModelimport com.arcgismaps.toolkit.geoviewcompose.MapViewimport com.esri.arcgismaps.sample.browsebuildingfloors.Rimport com.esri.arcgismaps.sample.browsebuildingfloors.components.BrowseBuildingFloorsViewModelimport com.esri.arcgismaps.sample.sampleslib.components.MessageDialogimport com.esri.arcgismaps.sample.sampleslib.components.SampleTopAppBarimport com.arcgismaps.toolkit.indoors.FloorFilter
/** * Main screen layout for the sample app */@Composablefun BrowseBuildingFloorsScreen() { val mapViewModel: BrowseBuildingFloorsViewModel = viewModel() Scaffold( topBar = { SampleTopAppBar(title = stringResource(R.string.browse_building_floors_app_name)) }, content = { Box( modifier = Modifier .fillMaxSize() .padding(it), ) { MapView( arcGISMap = mapViewModel.arcGISMap, modifier = Modifier.fillMaxSize(), ) Box(modifier = Modifier .align(Alignment.BottomEnd) .padding(bottom = 36.dp, end = 12.dp) ){ FloorFilter(floorFilterState = mapViewModel.floorFilterState) } }
mapViewModel.messageDialogVM.apply { if (dialogStatus) { MessageDialog( title = messageTitle, description = messageDescription, onDismissRequest = ::dismissDialog ) } } } )}