Hi,
The Layerlist widget ignore the minScale/maxScale that one set on a Sublayer (of a MapImageLayer)
Sublayer minScale
So layers is not grayed out when out of scale (as is the case in version 4.3)
Any way to get around this?
Hi Undral,
My mistake - I should have given you a different endpoint to use. It appears as though the Layer List widget will honor sublayer scales if the parent layer has either min or max set, as is the case with the Flowlines. However, I just swapped that URL out in your codepen example for this one: NHDPlus_NP21/WBD_NP21_Simplified (MapServer) (Note, max scale and min scale both set to 0 on the parent layer, but specified in all sublayers), and the layer list widget does not seem to respect the visibility ranges of the sublayers.
Let me know if you're seeing that too.
If you don' specify the sublayers on the MapImageLayer as per your example, then the map & layer-list will show all the sublayers on the service (as expected), but ignore any scale ranges that you have on them in the layer-list.
(Not an issue currently for me, but something I noticed before)
It might be frustrating if you need to list all the sublayers on a service just to get the scale ranges active. especially if it is a complex nested structure.
Hi there,
I could be missing the point you are making. Can you please take a look at this app? LayerList is behaving as expected from what I see: https://codepen.io/anon/pen/zjxRaP?editors=1000
The layers become visible at scale 288895.277144 and larger scales. Greyed out otherwise. The min scale for the your layers are specified as Min Scale: 288896.
Can you please give me a simple reproducible case? Thank you,
Ah, you're right Undral, if I set the max/min Scale on the sublayer manually when I request the MapImageLayer the app does respect them and the layers get gray-ed out appropriately.
However, the sublayer does not seem to automatically retrieve and respect the default max and min scales set on the endpoint (e.g., Layer: Flowlines (ID: 0) ).
Is that expected behavior?
This issue described here is fixed and here is a simple test app.
An Anonymous Pen on CodePen
Must still be an issue then. Have you called tech support to report this?
Hey Robert!
Unfortunately, I have tried switching to 4.7 and I'm still experiencing the issue.
Nathaniel,
Have you tried switching your API url to 4.7 to see if it has been fixed in the latest version?
Hey there,
I'm on 4.6 and am still experiencing this issue. Did the bug ever get addressed? If not, any guidance on a non-typescript work around would be much appreciated!
Best,
Nathaniel
Thanks Undral.
I use a customized version of the LayerList.tsx on GitHub, so were able to add a custom 'visibleAtCurrentScale' method as an interim fix/workaround to replace the 'item.visibleAtCurrentScale' (that have the bug).
For what it is worth - it seems the bug is in the 'isLayerOutsideScaleRange' function of "./support/layerListUtils" that might receive incorrect parameters, but I might be be wrong - it get tricky to read trough the obfuscated code.
Hi Gert,
I am able to reproduce the issue you reported. This issue will be fixed in our next release. I do not have a workaround at this time. Thank you for reporting this issue.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.