Table of content with checkbox and opacity slide bar

3204
6
10-15-2015 10:11 AM
ADITYAKUMAR1
Occasional Contributor III

Dear Users,

    I am working ona module where the user need a table of content(layer name)with check boxes

and a slides beside very layer name which can control opacity.

I tried some examples but could not reach any thing.

Any guide on this will be helpful.

Thanks

Aditya Kumar

0 Kudos
6 Replies
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Aditya,

You can try to take a reference about this user created sample that shared in arcgis.com: https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109

Technically if you need to change the layer opacity you need to take look this API documentation:

setOpacity(opacity)

ArcGISDynamicMapServiceLayer | API Reference | ArcGIS API for JavaScript

Hope this can help, also we recommend you use AMD style for JS

JeffJacobson
Occasional Contributor III

I have a layer list control that you might be able to use: WSDOT-GIS/arcgis-js-layer-list · GitHub

0 Kudos
TracySchloss
Frequent Contributor

A lot of people are using the TOC widget mentioned above, https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.arcgis.com%2Fhome%2Fitem.html%3F...

It's part of the functionality to allow you to change the opacity of an individual layer.  It's always worked fine for me. If one of the examples provided is close to what you want, but you're having problems with it, you ought to be able to post your code and get some assistance. 

0 Kudos
ADITYAKUMAR1
Occasional Contributor III

Hi All,

I am able to bring the list of check boxes in my map using layerlist widget.

var myWidget = new LayerList({

           map:map,

           layers: []

        },"layerList");

        myWidget.startup();

And its working fine. Need to add the opacity slider next to each layer.

Any suggestion?

Thanks

Aditya Kumar

KenBuja
MVP Esteemed Contributor

Take a look at this example that uses the LayerList with a opacity slider.

JS Bin - Collaborative JavaScript Debugging

JohnGrayson
Esri Regular Contributor

Here's another one you could try out:

jgrayson-apl/LayerListOpacity · GitHub