dojo.connect(dynamicMapServiceLayer, "onLoad", function () { var content = "" //return the layer descriptions into an array - we use this later for the info dialog to generate hyperlinks dojo.forEach(dynamicMapServiceLayer.layerInfos, function (layer) { var restAPIServicePage = { url: mapservice2 + "/" + layer.id + "?f=json", callbackParamName: "callback", load: function (data) { LayerDescriptions[layer.id] = data.description; } }; dojo.io.script.get(restAPIServicePage); }) });
var LayerDescriptions = []
var geom; //store the shape used for the identify task var map; //the map var tabs;//collection of tabs that each corresponds to a layer //when tab is selected //create identify task for corresponding layer using geom //display results
var ProgressBar = function() { var _id; var _bar = dijit.byId("progressBar"); var _numParts; var _progress; var _show = function(numParts) { if (numParts) { _bar.update({ indeterminate: false, maximum: numParts, progress: 0 }); _progress = 0; _numParts = numParts; } else { _bar.update({ indeterminate: true }); _progress = 0; _numParts = 0; } dojo.style("progressBarContainer", "display", "block"); dojo.style("waitingDiv", "display", "block"); centerElement(dojo.byId("divMapTabs"), dojo.byId("progressBarContainer")); }; var _hide = function() { dojo.style("progressBarContainer", "display", "none"); dojo.style("waitingDiv", "display", "none"); }; var _update = function() { _progress++; _bar.update({ progress: (_progress) }); if (_progress >= _numParts) { _hide(); } }; return { show: function(num) { _show(num); }, update: function() { _update(); }, hide: function() { _hide(); } }; };
I've had a similar issue in the past. I ended up issuing an Identify task for the active tab. When the user switched tabs, I would send another request for the layer that corresponded to the newly active tab.
Would it be better to have the client turn on the layers he would like to identify?
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.