mheinrich86

[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
Hello!
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});
        map.addLayer(operationalLayer);
.
.
.

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("http://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer");
map.addLayer(basemap);


and

var referenceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer");      
map.addLayer(referenceLayer);


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

Outcomes