2

I tend to get better help here then the ESRI forum so...

Using http://developers.arcgis.com/en/javascript/sandbox/sandbox.html I was able to create a simple application which demonstrates that if you set a non-trivial lods on a map the basemap will not behave correctly (try zooming beyond level 15).

Any workarounds?

<!DOCTYPE html>
<html>
<head>
  <title>Create a Map</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10">
  <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dijit/themes/claro/claro.css">
  <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/esri/css/esri.css">
  <style>
    html, body, #mapDiv {
      padding: 0;
      margin: 0;
      height: 100%;
    }
  </style>

  <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/"></script>
  <script>
    require([
        "esri/map", 
        "esri/layers/ArcGISTiledMapServiceLayer"
        ], 
        function (Map, ArcGISTiledMapServiceLayer) {

        var webLods = [
            //{ "level" : 0, "resolution" : 156543.033928, "scale" : 591657527.591555 },
            //{ "level" : 1, "resolution" : 78271.5169639999, "scale" : 295828763.795777 },
            //{ "level" : 2, "resolution" : 39135.7584820001, "scale" : 147914381.897889 },
            //{ "level" : 3, "resolution" : 19567.8792409999, "scale" : 73957190.948944 },
            //{ "level" : 4, "resolution" : 9783.93962049996, "scale" : 36978595.474472 },
            //{ "level" : 5, "resolution" : 4891.96981024998, "scale" : 18489297.737236 },
            { "level" : 6, "resolution" : 2445.98490512499, "scale" : 9244648.868618 },
            { "level" : 7, "resolution" : 1222.99245256249, "scale" : 4622324.434309 },
            { "level" : 8, "resolution" : 611.49622628138, "scale" : 2311162.217155 },
            { "level" : 9, "resolution" : 305.748113140558, "scale" : 1155581.108577 },
            { "level" : 10, "resolution" : 152.874056570411, "scale" : 577790.554289 },
            { "level" : 11, "resolution" : 76.4370282850732, "scale" : 288895.277144 },
            { "level" : 12, "resolution" : 38.2185141425366, "scale" : 144447.638572 },
            { "level" : 13, "resolution" : 19.1092570712683, "scale" : 72223.819286 },
            { "level" : 14, "resolution" : 9.55462853563415, "scale" : 36111.909643 },
            { "level" : 15, "resolution" : 4.77731426794937, "scale" : 18055.954822 },
            { "level" : 16, "resolution" : 2.38865713397468, "scale" : 9027.977411 },
            { "level" : 17, "resolution" : 1.19432856685505, "scale" : 4513.988705 },
            { "level" : 18, "resolution" : 0.597164283559817, "scale" : 2256.994353 },
            { "level" : 19, "resolution" : 0.298582141647617, "scale" : 1128.497176 }
        ];

     var map = new Map("mapDiv", {
        center: [-85, 35],
        zoom: 3,
        basemap: "streets",
        lods : webLods,
        slider : true,
        sliderStyle : "large"        
      });
    });
  </script>

</head>
<body class="claro">
  <div id="mapDiv"></div>
</body>
</html>

1 Answer 1

5

There's likely a bug here which I think we have a fix for in the next (3.5) release.

In the meantime, instead of using map.options.lods, try specifying minZoom and maxZoom to specify the range of levels you'd like your map to use.

2
  • This works but not for ArcGISDynamicMapServiceLayer as a base layer...can't set LODS on a dynamic layer? Setting both the map lods and the minZoom resolves this for dynamic and tiles layers.
    – ca0v
    Commented May 8, 2013 at 13:07
  • 1
    For a map with only dynamic layers, you'll have to use LODs. I've confirmed we've fixed this at 3.5 (due out in the next couple of days). Commented May 8, 2013 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.