Browse building floors

View inFormsWPFWinUIView on GitHub

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 combo box to browse different floor levels in the facility. Only the selected floor will be displayed.

How it works

  1. Create a PortalItem using the identifier of a floor-aware web map.
  2. Create a map using the portal item.
  3. Create a map view and assign the map to it.
  4. Wait for the map to load and retrieve the map's FloorManager property.
  5. Wait for the floor manager to load and retrieve the floor-aware data.
  6. Set all floors to not visible.
  7. Select the ground floor by default. The ground floor is the entry in a facility's level collection that has VerticalOrder of zero. Vertical order can be negative for underground floors.
  8. Set the selected level's IsVisible property to true.
  9. When the selected floor changes, set the old selection's IsVisible property to false, and the new selection's IsVisible property to true.
  • Note: Manually set the default floor level to the first floor.

Relevant API

  • FloorAware
  • FloorLevel
  • FloorManager
  • Map
  • PortalItem

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

The FloorManager API also supports browsing different sites and facilities in addition to building floors.

Tags

building, facility, floor, floor-aware, floors, ground floor, indoor, level, site, story

Sample Code

BrowseBuildingFloors.xamlBrowseBuildingFloors.xamlBrowseBuildingFloors.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<UserControl x:Class="ArcGISRuntime.WinUI.Samples.BrowseBuildingFloors.BrowseBuildingFloors"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
    <Grid>
        <esriUI:MapView x:Name="MyMapView" />
        <Border Width="150" Style="{StaticResource BorderStyle}">
            <StackPanel>
                <TextBlock Margin="0,0,0,5"
                           HorizontalAlignment="Center"
                           FontWeight="SemiBold"
                           Text="Select floor"
                           TextWrapping="Wrap" />
                <ComboBox x:Name="FloorChooser"
                          HorizontalAlignment="Center"
                          DisplayMemberPath="ShortName"
                          SelectionChanged="OnFloorChooserSelectionChanged" />
            </StackPanel>
        </Border>
    </Grid>
</UserControl>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close