Hello all,
I have created a web map in ArcGIS Portal from multiple data sources, these are all based on regions of the USA. I would like to have them grouped for visual organization when the map is displayed in the ArcGIS JS web app that I am building.
Currently the layer list looks like this:
North West - Buildings
North West - Harbors
North West - Land
South West - Buildings
South West - Harbors
South West - Land
I would like to have these items displayed like this:
> North West
North West - Buildings
North West - Harbors
North West - Land
> South West
South West - Buildings
South West - Harbors
South West - Land
I would like this to allow the user to do the usual toggle on and off of the layer list items, but I would like them to be collapsible into the region.
This is the code that I have so far:
const webmap = new WebMap({
portalItem: {
id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}); const view = new MapView({
container: mapDiv.current,
map: webmap
}); view.when(function() {
const layerList = new LayerList({
view,
});
view.ui.add(layerList, 'bottom-left');
});
I have not seen an example of a "Group Layer List" used like this yet. Is this possible to do with a single portal item (webmap) that provides all of the data?