out of visibility range layers do not grey out in the webapp builder layer list widget, can this be changed programmatically?
Amy,
This took a little work, but it was something I wanted for my site as well so here it is. Just take the attached file and overwrite the one you have in your stemapp and/or apps folder(s) "widgets\LayerList\LayerListView.js"
Perfect! Thanks
I think I spoke too soon. Are you having trouble zooming in and out with the layer list expanded?
What browser are you using? I tested in Firefox 38.05 & 39, IE 11, and Chrome 43.
Thanks Robert it works great. This will be very helpful for my users so I don't have to explain why something is not showing up and that they might have to just zoom in a little bit.
-Stan
I have used IE version 11 and chrome 43.0.2357.130 m & same problem
This enhancement does not seem to work with WAB version 1.2. Looks like the code for the LayerListView.js has changed a bit compare to version 1.1.
On the initial load the Map Services seem to be grayed out appropriately but the sub-layers that are listed within the Map Service are all grayed out all of the time. Zooming in and out does not update what should be grayed out either.
Any chance that there is an updated version for this enhancement?
Regards
All,
Here is a 1.2 compatible version.
Excellent, thank you Robert.
Your efforts are greatly appreciated.
Thank you for sharing. I discovered a problem with the scales at the opening, but adding this all works fine now.
startup: function () { this.checkScale (); },
Works a treat! Thanks Robert!
works in 1.2. PERFECT.
the newer version of LayerListView from 1.3 differs at line 175/176
does the newer syntax need to be added?
Frank,
Here is a 1.3 version
Robert-- Just plugged the 1.3 version in and noticing a small issue or two. One feature service in the map has 5 layers. All 5 layers have the same visibility extent setting. When zoomed to that scale, all the layers display on the map as they should, however two of them are greyed out as if not visible. I can still toggle them off and on and the map responds appropriately. I confirmed in ArcMap that the visible scales are the same for all layers. Any idea if this is something that needs fixed on my end?
Cole,
I have done some testing and I can not reproduce this.
It's been a few months since Cole's post, but I'm curious if this was his problem: With this modification, the first time you open the Layer List widget, all layer names inside of a map service appear grayed out until you zoom in or out. After that everything behaves as expected.
Here is the 2.0 version with a more ArcMap like feel to it (i.e the scale image on the checkbox).
Robert and other users, so you are aware, don't use the ampersand symbol (&) in layer or group names.... this causes the layer or groups visibility toggle checkbox to appear as though the layer is always out of range (even if it is in range or no scale range is set on the layer) ie use "This and That" instead of "This & That". I suppose it is probably best practice to avoid such characters anyways as they probably muck up strings in code.
Thanks for posting the 2.0 Version Robert, it works great and I like the icons!
Robert, thanks so much for this enhancement to the layer list widget. As always, it is much appreciated.
The scale dependency enforcement at the group layer level is working however the layer list widget display makes it appear as if the layer can still be viewed or turned on/off. With so many layers in the LL, users are getting confused as to why they can't see the layer if it is turned on. Again, this more of a UI issue. The underlying logic is working well. If I remember correctly, this seemed to be the case with the flex viewer. The originating map maker could set the scale at the group level and the layer list would honor the display as well as the scale level.
To implement this in WAB, would the best approach be to pass the min scale from the parent layer ID to the sub layer ID min scale or is this a valid approach? If I am overlooking something obvious I apologize in advance.
Thanks again!
Emerson,
I am looking into it.
Here is a 2.1 version that addresses the issue that Emerson brought up above:
Thanks so much Robert for the fast turn around! I added the files to my app and unfortunately see the attached error. It looks as if the isInScale function isn't included in this iteration? Comparing the two side by side this looks to be the biggest difference. There are obviously others however this one was the most prominent.
Any help is greatly appreciated!
The latest version posted is for WAB 2.1 or greater. I seems you are using it in something older.
Oh...OK. Sorry about that Robert. I overlooked, "Here is a 2.1 version that addresses the issue". I will try to implement in 2.1. My apologies for the oversight.
Hi All,
Anyone else having an issue with the Layer List widget in WAB 2.1 where tiled Map Services are still greyed-out when you reach the first scale level that the layer becomes visible? Once you zoom in one more level the layer is no longer greyed-out as it should be. This does not seem to be an issue in previous releases and I still see the issue in WAB 2.2.
I checked the visible scale ranges for all of my Map Services and they are all setup appropriately.
Dynamic Map Services work fine.
Regards,
Michael
Michael,
I did notice that even on my site but I have not been able to track the issue down.
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.