I would like for my users to be able to turn layers on and off so they can see just street signs or supports. I have tried using this widget, but it does not work: http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109http://Is there a way to add a checkbox next to the layer in the legend widget to turn layers on/off?
My code for starting the legend is the following:
app.legend = new Legend({
map: app.map,
layerInfos: [{
title: app.supportLayer.name,
layer: app.supportLayer
}, {
title: app.signLayer.name,
layer: app.signLayer
}]
}, "legend");
app.legend.startup();
I used the "default.html" file and it appears to show all the layers in your services. The only edit was to remove the proxy configuration. Which layers are missing?
How do you mean that widget doesn't work?What are the issues that you're having? I've used it in many applications without any problem.
There are some other TOC widgets, like this or this, with others out there on GitHub also.
Here is the file I uploaded that doesn't work. It kind of works, but does not show all layers.
https://community.esri.com/docs/DOC-5792
kenbujais right. I also use this widget a lot and it's now updated as well.
I tried it and I set always use proxy to false. There appears to be a delay before it populates, but it does populate. Thanks @Ken_Buja. I'll try to add it to my application.
It's been updated? When was that? I might want to try out the update.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.