Solved! Go to Solution.
Thanks Jeff...Yes i totally agree with you. I wish map click could return something more than mappoint like clicked graphic/layer etc...or map object has event like getAllvisible layers instead of getting all layers..
Thanks again
Is there a generic identify tool, which finds out which layer was clicked and then return all the attributes...by getting layers and layerIDs just by clicking on the map....
I am going to work on this but i thought should check if anybody already did something similar...
There is no identify dijit. There is an identify task, however, that you can pass an onclick and will let you choose ALL, TOP, or VISIBILE to identify.
Yes but you have to specify the URL and then choose layers...is it a way that you click on map, get all the visible layers and then use all those layers to do the identify?
This way i can write a function where i can pass all the visible layers at map click and then iterate through each layer and get results...
thanks
var ids = map.layerIds; dojo.forEach(ids, function(id) { var layer = this.map.getLayer(id); if (layer.visible==true){ //do identify on layer.url } }
Thanks Jeff...Yes i totally agree with you. I wish map click could return something more than mappoint like clicked graphic/layer etc...or map object has event like getAllvisible layers instead of getting all layers..
Thanks again
I agree, unfortunately without querying the map (i.e. looping through the layers) there is no way to know which layer you clicked.
A map.visibleLayerIds would be a very useful property, however.
If you dont mind marking my response as an answer, i would appreciate it 🙂