AnsweredAssumed Answered

Onclick event for a sublayer in a ArcGISDynamicMapServiceLayer

Question asked by natevatt on Nov 25, 2014
Latest reply on Nov 25, 2014 by natevatt

Hi there,


I have an ArcGISDynamicMapServiceLayer which consists of maybe 40 or so sublayers and I would like to trigger an onclick event for a specific sublayer within an ArcGISDynamicMapServiceLayer.  For instance, if I select a polygon of the sublayer, I want to create a chart in a seperate div. This is pretty easy to do with FeatureLayers, ie:


var featureLayer = new esri.layers.FeatureLayer("https://blah blah blah", { options  });

featureLayer.on("click", function (evt) {

     // Do something



However, I am not sure if this is possible with ArcGISDynamicMapServiceLayer.


The reason that I am hoping to add an event to a sublayer is that i need the sublayers to sit underneath the top layer in a table of contents view. The only other way that I can come up with is to put several featureLayers together and somehow group them in a group layer within the table of contents.  I am also not sure how to do this, but in theory this could be possible. 


Any ideas?