Explanation:
I'm currently trying to change the visible legend when a user selects one of three grouped layers to view. These can then be interacted with in a LayerList widget. Only one layer can be selected at a time, so the legend won't clash with any others. I've tried to look up for an event that runs on selecting a different layer via the LayerList, but haven't come across anything yet. Is this possible?
Code:
var groupLayer = new GroupLayer({
title: 'Tauranga Points of Interest',
visible: true,
visibilityMode: 'exclusive',
layers: [LAYERS_ADDED_IN_HERE],
opacity: 0.7
})
Images:
Showing the first legend - all normal.
Other legends not showing on layer change. The legend is currently trying to display the same 'Tsunami Evacuation Zones' layer as before.