I have created a map that has a Table of Content that i use to turn on and off desired layers. Is there a way to create a 'Clear' button that will untoggle the selected layers? I have a clear button that clears other selections but I am stuck. I am using ArcGIS API for JavaScript 3.17.
var myLayerList = new LayerList({
map: map,
showLegend: false,
layers: [
waterFeature,
volleyball,
trashcan,
tennis,
table,
soccerField,
shadeStructure,
restroom,
ramada,
pool,
playground,
pathway,
parkSign,
parking,
park,
light,
horseShoe,
grill,
drinkingFountain,
dogPark,
dogBag,
discGolf,
communityGarden,
bikeRack,
benches,
battingCages,
basketball,
ballfield]
}, "layerList");
myLayerList.startup();
query("#clearQuery").on('click', function (evt) {
//reset the definition expression
selectedLayer.setDefinitionExpression('1=1');
map.graphics.clear();
});