View on GitHub Sample viewer app

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

BrowseBuildingFloorsApp

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

  1. Create a PortalItem using the itemId of the floor-aware web map, and use it to create an ArcGISMap.
  2. Create a FloorFilterState, passing it the map as its geoModel, and configure its UIProperties (e.g. maxDisplayLevels, closeButtonPosition).
  3. Display the map in a MapView.
  4. Display a FloorFilter composable over the MapView, passing it the FloorFilterState, 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

BrowseBuildingFloorsViewModel.ktBrowseBuildingFloorsViewModel.ktMainActivity.ktBrowseBuildingFloorsScreen.kt
/* 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.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.viewModelScope
import com.arcgismaps.mapping.ArcGISMap
import com.arcgismaps.mapping.PortalItem
import com.arcgismaps.portal.Portal
import com.arcgismaps.toolkit.indoors.FloorFilterState
import com.esri.arcgismaps.sample.sampleslib.components.MessageDialogViewModel
import 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) }
}
}
}