monzay

Tiled layer does not display all levels

Discussion created by monzay on Dec 16, 2011
Latest reply on Dec 20, 2011 by monzay
I'm using two tiled services to display in my map. The ocean basemap and the world light gray canvas map. If I zoom past level 9 on the US Virgin Islands, the ocean basemap shows me "map data not yet available". I understand that part. What I don't understand is why the other basemap I've set up to display on the map does not appear until level 14. This happens regardless if I use the displayLevels parameter. Yet, if I look at that service through the services directory in the Javascript viewer I can see all of the levels including the ones between 9 and 14.


 
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
    <!--The viewport meta tag is used to improve the presentation and behavior of the samples
      on iOS devices-->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
    <title>
      Overview Map
    </title>
    <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.6/js/dojo/dijit/themes/claro/claro.css">
    <style>
      html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
    </style>
    <script type="text/javascript">
      var djConfig = {
        parseOnLoad: true
      };
    </script>
    <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6">
    </script>
<script type="text/javascript">
      dojo.require("dijit.layout.BorderContainer");
      dojo.require("dijit.layout.ContentPane");
      dojo.require("esri.map");
      dojo.require("esri.dijit.OverviewMap");
      var map;

      function init() {
        var initExtent = new esri.geometry.Extent({
          "xmin":-7413378.648884336,"ymin":1898800.4677371255,"xmax":-7031499.25557178,"ymax":2094785.0082602233,"spatialReference":{"wkid":102100}
        });
        map = new esri.Map("map", {
          extent: initExtent
        });

        //resize the map when the browser resizes - view the 'Resizing and repositioning the map' section in
        //the following help topic for more details http://help.esri.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_guidelines.htm
        var resizeTimer;
        dojo.connect(map, 'onLoad', function(theMap) {
          //resize the map when the browser resizes
          dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
        
          //add the overview map
          var overviewMapDijit = new esri.dijit.OverviewMap({
            map: map
   });
          overviewMapDijit.startup();
        });

 

 
  basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer",{displayLevels:[10,11,12,13,14,15,16]});
  map.addLayer(basemap);
 
   oceanBM = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer");
  map.addLayer(oceanBM);
 



      }

      dojo.addOnLoad(init);
    </script>

</script>
  </head>

  <body class="claro">
    <div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width: 100%; height: 100%; margin:0;">
      <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="padding:0">
      </div>
    </div>
  </body>

</html>

Outcomes