I have task when i click on map, active layer information show on popup window, it is possible with query task but i have many map services and activate it dynamically. means whatever feature on map I want to show information when i click on feature without define map or feature service. I want to get feature on map service when click on respective feature then i want to query. is it possible ?.........Thanks
Solved! Go to Solution.
What API version are you working with?
In 3.19 you can easily get the visible layers through the map objects different layer properties e.g.
map.layerIds or map.graphicsLayerIds
Then you can check if the layer is visible, get the URL for the layer and get the layer properties as JSON through a standard request (https://[server]/arcgis/rest/services/[service]/MapServer/[layerID]/?f=pjson)