hi....
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.
Take a look at this discussion, which returns the map service information for layers in different services.
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)
Prasad,
You could use the IdentifyTask for this if you do not want to send a query to each individual layer.
Take a look at this discussion, which returns the map service information for layers in different services.
Thanks.... ken your code exactly match my requirement. it is very helpful for me..
If this answered your question, please click the Mark Correct button.