LayerList 4.4 minScale/maxScale now ignored

2128
15
07-11-2017 04:03 AM
GertConradie
Occasional Contributor

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? 

0 Kudos
15 Replies
deleted-user-0rxRICUw9_JJ
New Contributor

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.  

0 Kudos
deleted-user-0rxRICUw9_JJ
New Contributor

Apologies - this is not correct any more - I tested this with your test codepen and it behave as expected (honoring the scales) even if i go back to v4.4

No, it is actually correct as per the use case in the next user's comment.

0 Kudos
NathanielRindlaub
New Contributor III

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.

0 Kudos
deleted-user-0rxRICUw9_JJ
New Contributor

This is what I noticed before as well - will update my responses. (again)

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there,

Sorry for the delay.  What you are seeing is an expected behavior. If you are setting sublayers then you have to set the min/maxscale for them. Otherwise, they will use the parent layer's min/maxScale. For example, the parent layer's min/maxScale 0 then your sublayer will have min/maxScale of 0. If you add the parent layer without setting sublayers then min/maxscale is honored for all layers.

For example, I updated the test app just to add the mapimagelayer without setting sublayers... in this case, the min/maxscale are read from the mapservice. 

Hope this makes sense,

-Undral

NathanielRindlaub
New Contributor III

I see, and yes that does make sense. Thanks so much for your help Undral!

0 Kudos