[Beginner] How to query and retrive data with multiple layers?

Discussion created by mheinrich86 on Jan 21, 2013
Latest reply on Jan 22, 2013 by stevel
We are running an ArcGis Server and I've been given the task to write up some html/js templates for several projects. Unfortunatly I got stuck right at the beginning.

I used this sample to query a service and retrive a simple ID just to test it.

We dont serve topological data, so I just kept the baselayer and reference layer provided in the sample. And here lays my problem.

If I keep var map = new esri.Map("map"); and just use
var operationalLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://defg1gis01/ArcGIS/rest/services/bohrarchiv_da/MapServer", {"opacity":0.5});

var queryTask = new esri.tasks.QueryTask("http://defg1gis01/ArcGIS/rest/services/bohrarchiv_da/MapServer/6");

everything which should be displayed gets displayed and I can click the shapes and do get some information back.

However; if I add

var basemap = new esri.layers.ArcGISTiledMapServiceLayer("");


var referenceLayer = new esri.layers.ArcGISTiledMapServiceLayer("");      

I cant click on the highlighted shapes to get a neat little popup serving the needed information. Every layer gets displayed, but the operationalLayer is not interactive anymore.

Can somebody help me out? I can't figure out where I went wrong.

Kind regards