var deferred = identifyTask.execute(identifyParams); deferred.addCallback(function(response){ return dojo.map(response, function(result){ var feature=result.feature; feature.attributes.layerName = result.layerName; var template = new esri.InfoTemplate("${Name}", "${*}"); feature.setInfoTemplate(template); return feature; }); }); map.infoWindow.setFeatures([deferred]); map.infoWindow.show(evt.mapPoint);
I am trying to toggle the visibility of a particular div container when certain layers are visible. I am using the table of contents widget to toggle layer visibility from the following link: http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109. I have the identify task working properly for the visible layers using the following code and I think that I need to do something similar to get the visible layer name, however, I cannot seem to modify it to work for toggling the div visibility:var deferred = identifyTask.execute(identifyParams); deferred.addCallback(function(response){ return dojo.map(response, function(result){ var feature=result.feature; feature.attributes.layerName = result.layerName; var template = new esri.InfoTemplate("${Name}", "${*}"); feature.setInfoTemplate(template); return feature; }); }); map.infoWindow.setFeatures([deferred]); map.infoWindow.show(evt.mapPoint); Could someone please provide guidance on how I can go about this? Thanks in advance.
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.