My table of contents has 4 group layers (each group can have multiple layers). When the user clicks on "Critical Area" group, I also want the event to check on and draw the "Percent Slope" group. I'm not really interested in answering questions about why I would want to do this way, because it is kind of nutty, but rather, how to do this in the javascript code, so that I get better at tinkering with the widgets. I'm able to write to the console if a user checks on "Critical Areas" but not at all sure how to have the code check on and draw the "Percent Slope" group:
From the "LayerListView.js" in the Layer list widger for webappbuilder:
_onCkSelectNodeClick: function(layerInfo, ckSelect, evt) {
if (ckSelect.checked) {
layerInfo.setTopLayerVisible(true);
// test how to find layer name
if (layerInfo.title === 'Critical Areas')
{
console.log(layerInfo.title);
// I want this to check on and draw another group in the layer list--Any ideas?
}
} else {
layerInfo.setTopLayerVisible(false);
}
evt.stopPropagation();
},
Solved! Go to Solution.
You mean to change from one theme (group to another group) like in the above mentioned application? example From Surface Water Bodies to Protected area and so on?
You are right @ Robert Scheitlin, GISP I am not switching between web maps, its only loading another map layers.This was accomplished via a widget created for such purpose as there is no way to group service into categories as of today in arcgis api for javascript 3.xx, pardon me if there is possibility to group layers.
yeah i mean how to change from one group to another . is it a group of layer or webmaps ? and if it is a group of layers how to do so ?
How to group layers please ?
Can you explain to me more how to group layers and how to get the widget to toggle between groups of layers ?
So are you changing the web map in that widget?
No I am clearing the previous maps and add the new group using the buttons.
Can you explain to me more how to group layers and how to get the widget to toggle between groups of layers ?
I think It would be easy for me to share the widget than to explain it here . Give me some time though?
Ok Mr Mehretab T.Sium . Thank you so much . really thank you so much .
Hi Mehretab ,
What about the widget to toggle betwenn group of layers ?