API 4.7 LayerList strange behaviour

1443
8
06-19-2018 07:32 AM
DavideLimosani
Occasional Contributor II

Hello everyone, 

I have a big project with API 4.6 that is based on updates of LayerList Widget. I have found a big difference in the behaviour from 4.6 to 4.7.

Look at this sample:

JS Bin - Collaborative JavaScript Debugging 

After 5 seconds all layers in map are removed. With API 4.6 the LayerList widget is completely cleaned, with 4.7 no, some layers / group layers are still there. 

I know that 4.8 aren't officially released yet, but with 4.8 the behaviour is even different from 4.6 and 4.7......

Is this a bug? Is there some way to completely refresh LayerList widget after removing all layers from the map? 

Thank you,

Davide

0 Kudos
8 Replies
MattDriscoll
Esri Contributor

Hey David,

This does look like a bug. We'll look into it and report back what we find. Should be able to get this fixed for 4.8.

Thanks for reporting!

DavideLimosani
Occasional Contributor II

Hello Matt,

thanks for you answer. Please let me know because i need to know as soon as possibile if i can switch my application to 4.7 /4.8 or otherwise if i am stuck at 4.6. I strongly need to combine LayerList and Legend widget and the funcionality is not present in 4.6...

Regards,

Davide

0 Kudos
MattDriscoll
Esri Contributor

Hey Davide,

We're working to get this fixed for 4.8 which will be the next release. If you would like to use 4.7, here is a workaround for the issue:

JS Bin - Collaborative JavaScript Debugging 

-Matt

MattDriscoll
Esri Contributor

We've addressed the issue in 4.8. Thanks for letting us know!

AbebeD
by
New Contributor

Hi Matt,

We submitted multiple cases related to Layer List Widget ( up to 4.7) ... my issue originally was related to the fact that the checkbox for sub layers do not honor visibility of layers ( as the scale changes). The labeling however used to honor the visibility ( it still looks the vase in 4.8) . Those issues look a luxury now  

I could at least see the check boxes to hide or show the sub layer. 

Now it looks worse .. there is no checkbox for the sub layers ... 

Thanks, 

0 Kudos
DavideLimosani
Occasional Contributor II

Hi Abebe, 

check the VisibilityMode of your sublayers. It should be "independent" and not "inherited".

Davide

AbebeD
by
New Contributor

That suggestion does not apply to a case where you have a single map service that contains group layers and layer groups will be visible at predefined scales ... because you add it as a single MapImageLayer , because that property is for GroupLayers

0 Kudos
HarshPathak1
New Contributor III

Hello,

There is a bug being logged for JavaScript 4.8 for this issue.

The number is- BUG-000115608 (Cannot the set ON/OFF visibility of the sublayers from LayerList widget in JavaScript application).

You can track the bug via support.esri.com to see the status of the bug.

Harsh

0 Kudos