prerana

mix tiled and dynamic map on a single display

Discussion created by prerana on May 12, 2012
Latest reply on Jan 26, 2015 by mark_hiscocks
Hello All,

I want to use tiled and dynamic service on a single map.

Let me introduce you to the problem and give a background for doing this.
I have a map where I am caching the ground areas but due to space constraints, I want to avoid caching the oceans.
Now, I have achieved this by restricting the tiles creation using the feature class. The problem is that in this approach, the tiles would keep on growing on larger scales, if the users go to the oceans areas and zoom/pan. So, as a solution, I am trying to use a combination of tiles and caches to avoid this slow but steady increase of space cache takes on disk.

I feel that this would be the most common problem on any mapping service, but I have not been able to find a solution to this problem online.
I have tried using adding two layers, one tiled other dynamic, to the map, but I cannot view both together on the screen. Only dynamic is shown...
Also, firebug shows these errors:
[ATTACH=CONFIG]14280[/ATTACH]

This is the sample javascript:

     function init() {
        loading = dojo.byId("loadingImg");  //loading image. id --> Not present, no problem
        var extent = getExtent();
        initExtent = new esri.geometry.Extent({
                                                "xmin":-100,
                                                "ymin":13,
                                                "xmax":-85,
                                                "ymax":24,
                                                "spatialReference":{"wkid":4326}
                             }); //spatial reference for lat/long            
        esriConfig.defaults.map.slider = { left:"10px", top:"10px", width:null, height:"150px" };
        map = new esri.Map("map", {extent:initExtent, slider: true});
        var imageParameters = new esri.layers.ImageParameters();
        
        imageParameters.format = "JPEG";  //set the image type to JPEG, note default is PNG8.
        
  map.addLayer(new esri.layers.ArcGISDynamicMapServiceLayer("http://192.168.250.75:8399/arcgis/rest/services/surroundings/MapServer")); 
 ground = new esri.layers.ArcGISTiledMapServiceLayer( "http://192.168.250.75:8399/arcgis/rest/services/mexLoadBal/MapServer");
 dynamicMapServiceLayer09 = ground;
        var imageParameters = new esri.layers.ImageParameters();
        imageParameters.format = "JPEG";  //set the image type to JPEG, note default is PNG8.

 
        var layer = map.addLayer(dynamicMapServiceLayer09);
        if (layer == null)
            {
                alert("map layer is null, could not add map layer to map");
            }
                    
 map.reorderLayer(ground,0);

        dojo.connect(map, "onClick", function(evt) {
          map.graphics.clear();
          locator.locationToAddress(evt.mapPoint, 500);
        });

        dojo.connect(map,"onUpdateStart",function(){
          esri.show(dojo.byId("status"));
          showLoading();
        });
        dojo.connect(map,"onUpdateEnd",function(){
          esri.hide(dojo.byId("status"));
          hideLoading();
        });
        
        dojo.connect(map, "onExtentChange", showExtent);
        dojo.connect(map, "onExtentChange", saveExtgent); // save Extent of the current loaded map
        dojo.connect(map, "onMouseMove", showCoordinates);
        dojo.connect(map, "onMouseDrag", showCoordinates);   
        dojo.connect(map, "onLoad", createMenus);
           
      }
      /*****************************************/


Regards,
Ashish

Attachments

Outcomes