AnsweredAssumed Answered

Working with 2 DynamicMapServiceLayers

Question asked by mcdade31 on Oct 26, 2012
Latest reply on Oct 29, 2012 by mcdade31
I have two dynamic layers I need to add to my map. Both draw, but one (a parcel layer) is drawing underneath the zoning layer. I'd like them to draw so that both are visible. The parcels layer is outline only symbology so that shouldn't be the dealbreaker.

Here is what I have, with my legend code mixed in. I haven't changed the legend code to add the parcels layer yet as I'm just focusing on seeing both layers at the same time.

    layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://gisprod2/ArcGIS/rest/services/Dynamic/Zoning/MapServer");     parcellayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://gisprod2/ArcGIS/rest/services/Dynamic/Parcels/MapServer");      //Add the Legend     legendLayers.push({layer:layer,title:''});     dojo.connect(map,'onLayersAddResult',function(results){           var legend = new esri.dijit.Legend({             map:map,             layerInfos:legendLayers           },"legendDiv");           legend.startup();         });     map.addLayers([parcellayer,layer]);            if (layer.loaded) {           buildLayerList(layer);         }         else {           dojo.connect(layer, "onLoad", buildLayerList);         }

Outcomes