WebMap JSON and Identifying Visible Layers

4085
2
02-04-2014 11:56 AM
MattNicol
New Contributor III
I am creating my map based on the Web Map JSON format:

http://resources.arcgis.com/en/help/arcgis-web-map-json/#/Web_map_format_overview/02qt00000007000000...
https://developers.arcgis.com/javascript/jsapi/esri.arcgis.utils-amd.html#createmap

Doing this, identify operations are automatically set up according to the popup configuration in the JSON.  (In other words, I don't have to write code myself to set up IdentifyTasks.)

If a given operational layer is visible, the default identify behavior appears to identify against the default visible layers.  However, I am switching layers on and off through the setVisibleLayers function here:

https://developers.arcgis.com/javascript/jsapi/arcgisdynamicmapservicelayer-amd.html#setvisiblelayer...

Doing this, the pop-ups will sometimes display results for layers that aren't visible.

Is it possible to change this behavior without rewriting the identify logic myself?

Thanks!
0 Kudos
2 Replies
AdamConner
New Contributor
I am struggling with this same issue. I'd prefer no to rewrite the identify logic, as there are many layer types already supported by the default behavior. There must be a mechanism for changing this so the popup respects it but I have yet to find it. I will post here if I stumble across a solution.
0 Kudos