cannot get new floorfilter widget working

518
4
05-03-2021 12:56 PM
johnbrosowsky
Occasional Contributor

For the life of me I cannot get the new FloorFilter widget working.  My web map has a Levels layer, and a Facilities layer, and they have the necessary fields and attributes per documentation, but the floor filter widget does not light up and I receive the error "Facilities and Levels are required for the Floor Filter widget".

Any tips or tricks?

Thanks!

JB

 

 

 

0 Kudos
4 Replies
AnneFitz
Esri Contributor

Hi John - would you be able to share a simple repro so we can take a look at the error?

0 Kudos
johnbrosowsky
Occasional Contributor

you bet - steps to reproduce:

-- open the developer sample in the sandbox and observe that it works: https://developers.arcgis.com/javascript/latest/sample-code/widgets-floorfilter/

-- replace the web map ID in the developer sample in the sandbox with "60851c8a3f3d4c9ca1215d0e9c24dc25" and observe that now it does not work 

-- Check out the web map here:  https://www.arcgis.com/home/item.html?id=60851c8a3f3d4c9ca1215d0e9c24dc25

-- The webmap was created from Esri indoors tutorial data for Building L which appears to be the same map data used in the working developer example:  Building L Interior - Overview (arcgis.com)

 

Thanks!!

 

0 Kudos
tomhillgeo
Esri Contributor

Hi John, in order to create a floor-aware web map, you will need to upgrade to ArcGIS Pro 2.8.  There are new floor properties that must be configured for your map and layers in ArcGIS Pro before you share it as a web map for use with the JavaScript API.  Those properties allow you to choose which layers in your map represent facilities and floor levels.

You can learn about configuring a floor-aware map here:

https://pro.arcgis.com/en/pro-app/latest/help/data/indoors/configure-floor-aware-maps.htm

0 Kudos
johnbrosowsky
Occasional Contributor

I followed the ArcGIS Pro instructions - installed ArcGIS Pro 2.8, added my sites, facilities, levels, and units layers the map, clicked on map properties and there is no indoor layers tab as described in the documentation. Maybe that requires an ArcGIS Indoors license?

The ArcGIS JS API documentation states that the alternatively from setting these properties in ArcGIS Pro, they may be configured programmatically via the JS API.  After fiddling with it for a bit I got the FloorFilter widget working by setting the layer and floor info properties manually like this:

const mySiteLayerInfo = new SiteLayerInfo({
layerId: "sites_view_9488",
siteIdField: "SITE_ID",
nameField: "NAME",
});

const myFacilityLayerInfo = new FacilityLayerInfo({
facilityIdField: "FACILITY_ID",
layerId: "facilities_view_8594",
nameField: "NAME",
longNameField: "NAME_LONG",
siteIdField: "SITE_ID",
});

const myLevelLayerInfo = new LevelLayerInfo({
facilityIdField: "FACILITY_ID",
layerId: "levels_view_4226",
levelIdField: "LEVEL_ID",
levelNumberField: "LEVEL_NUMBER",
longNameField: "NAME",
shortNameField: "NAME_SHORT",
verticalOrderField: "VERTICAL_ORDER",
floorField: "LEVEL_ID",
});

const myFloorInfo = new MapFloorInfo({
siteLayer: mySiteLayerInfo,
facilityLayer: myFacilityLayerInfo,
levelLayer: myLevelLayerInfo,
});

const webmap = new WebMap({
portalItem: {
id: "1c020f2cdab3436ca7d54facf6bfab00",
},
floorInfo: myFloorInfo,
});

 

 

 

 

0 Kudos