Select to view content in your preferred language

How to filter out layers that are not visible in the current view extent from displaying in the legend

209
0
03-11-2024 09:42 AM
MarkEslinger
New Contributor

We have a MapImageLayer which has 60+ sublayers that's rendered on a view.By default all the sublayers have their visible property set to true. These may be visible/hidden based on the geographic region that's displayed on the current view extent.We have a legend widget associated to the view and they display all the sublayers since their visible property is set to true,even if the layers are not visible on the current extent. We want to legend to display only the sublayers that's actually visible in the view.

We are using JS SDK 4.x. We have tried setting respectLayerVisibility property of the legend to true.Our assumption is that it doesnt take into consideration if a sublayer is visible in the current view extent or not.

Any suggestions on how we can filter out the layers that are not visible in the current view extent will be of great help

0 Kudos
0 Replies