Setting max and min zoom level for map

14009
18
03-07-2014 07:20 AM
vinayb
by
New Contributor III
HI All,

I wan to set zoom level , that is i want to define maximum level upto which user zoom-out and min level to which user can zoom in .
0 Kudos
18 Replies
JeffPace
MVP Alum
This has been requested before (setting absolute min/max levels) but has not been implemented yet.  We have been told it is planned for a future release

As of now you can handle this by creating your map with custom LODs.  The problem with this is level 5 (for example) is your LOD5, which does not necessarily line up with the common absolute Level 5 of accepted basemap scales.
0 Kudos
vinayb
by
New Contributor III
I just have to zoom in and zoom out for max 2 levels, how can create lod
0 Kudos
JeffPace
MVP Alum
var lods =
            [
                {
                    "level": 0,
                    "resolution": 156543.03392800014,
                    "scale": 5.91657527591555E8
                },
                {
                    "level": 1,
                    "resolution": 78271.51696399994,
                    "scale": 2.95828763795777E8
                }
            ];

map = new Map("map", {
                                    basemap: "streets",
                                    autoResize: true,
                                    logo: false,
                                    showAttribution: false,
                                    lods: lods
                                });
0 Kudos
vinayb
by
New Contributor III
can you please give me for level2 too , but thanks it worked great
0 Kudos
JeffPace
MVP Alum
THey are available from any rest endpoint

http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer

"lods": [{
                      "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
                    }, {
                      "level": 20,
                      "resolution": 0.149291070823808,
                     "scale": 564.248588
                    }]
0 Kudos
vinayb
by
New Contributor III
but all the levels only zoom in there no levels for zoomout ?
0 Kudos
vinayb
by
New Contributor III
All these levels only zoom in there are no levels for zoom out
0 Kudos
JeffPace
MVP Alum
I am not sure what you are asking.  You have to pick which levels you want to use.
0 Kudos
vinayb
by
New Contributor III
I userd the Lods that you gave when i used them i was able to zoom in (-) upto 3 levels but i was not able to zoom out i.e using (+) button  .



how are these LODS available for my map below is the extent

I dont have TILED MAP

var initExtent = new esri.geometry.Extent({"xmin": -2.0037507067161843E7

,"ymin":-7516889.1782586705

,"xmax":2.0037507067161843E7

,"ymax":1.8398924324645087E7

,"spatialReference":{"wkid":102100}});



how can i find lods for my map
0 Kudos