crisjacome

Adding layers ArcGISDynamicMapServiceLayer and DynamicMapServiceLayer to a map

Discussion created by crisjacome on Mar 21, 2013
Latest reply on Mar 22, 2013 by crisjacome
Hello

I have an application where the user can show/hide a number of layers.

 streets = new esri.layers.ArcGISDynamicMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer", { "opacity": 0.5, "imageParameters": imageParameters });
            satellite = new esri.layers.ArcGISDynamicMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer", { "opacity": 0.5, "imageParameters": imageParameters });


etc....

And can also activate other WMS layer like this example http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/demos/layers/layers_custom_wms.html.


My problem is that when the first active layer is wms (DynamicMapServiceLayer) and then layer ArcGISDynamicMapServiceLayer, I see both correctly. But if the first active layer is ArcGISDynamicMapServiceLayer and then layer DynamicMapServiceLayer I can not see the latter on the map.

//This way don't work
map.addLayer(streets);
map.addLayer(new WMSLayer());


I have to change the order of layers?
I can solve the problem in another way?

Sorry for my english.

Thanks.

Outcomes