AnsweredAssumed Answered

Multiple ArcGISDynamicMapServiceLayer IdentifyTask

Question asked by lorieme on Jun 1, 2017
Latest reply on Jun 5, 2017 by lorieme

I used the sample cleverly written in post Identify Sample and modified it by setting visible layers for only a few layers in each map service.  However, when I click on the map, the identify brings up results for all the layers I clicked on even though they are not visible in the map.  

 

In this code snippet, the layer.visibleLayers[0] =  0,33,38,13.  Can someone explain those results?

 

function mapReady(map) {
dojo.connect(map, "onClick", runIdentifies);
pointsLayer.setVisibleLayers([33]);
linesLayer.setVisibleLayers([38, 44]);
polygonsLayer.setVisibleLayers([13, 27, 53, 62, 83]);
}

...

layers = dojo.filter(layers, function (layer) {
if (layer.visibleLayers[0] !== -1) {
return layer.getImageUrl && layer.visible
}

 

Can someone help me understand how multiple map services are handled in the identify task?  For a single map service, the identifyParams.layerIds is set to the index values of the layers to identify.  For multiple map services, is the identifyParams.layerIds set to the map url AND the index of the layer?  How does the IdentifyTask know which index belongs with which map service?

 

Thank you.

Outcomes