ArcGISDynamicMapServiceLayer and ArcGISTiledMapServiceLayer not working together

628
1
07-11-2012 12:04 PM
shawndeutch
New Contributor III
I have an aerials layer which needs to be the base map layer.  It is not cached so it is my ArcGISDynamicMapServiceLayer.  I have a roads layer that is cached and is my ArcGISTiledMapServiceLayer. 

I want the roads to sit on top of the aerials however it seems if I load the Dynamic map layer first than the tiled map layer will not display.

Is it the case that a Tiled Map Service Layer MUST be loaded first?
0 Kudos
1 Reply
shawndeutch
New Contributor III
It seems that it is indeed the case that a Tiled Map Service Layer must be loaded first so the map can be set up with the proper LOD levels.  I set the extents and projection in the javascript so it would not be that causing the issue.

So I added the roads first, the aerials second, and then used the reorderLayer method to push the aerials to be the bottom layer and it works fine this way.

See Below for a short example:

var DallasRoadsTiledMapLayer = new esri.layers.ArcGISTiledMapServiceLayer(DallasRoadsMapService);
ViewerMap.addLayer(DallasRoadsTiledMapLayer);
   

var aerialPhotos = new esri.layers.ArcGISDynamicMapServiceLayer(aerialPhotosMapService);  
ViewerMap.addLayer(aerialPhotos);
ViewerMap.reorderLayer(aerialPhotos, 0);
0 Kudos