Select to view content in your preferred language

Possible 4.0 beta 1 bug? (view.minZoom)

2706
2
Jump to solution
09-25-2015 06:45 AM
TyroneBiggums
Occasional Contributor III

Please review the following code and let me know if I'm missing something. It appears that minZoom is ignored. A map appears but the user can zoom the map out all the way. I tried setting the minZoom property when I initialize a MapView instance. And, please notice that I tried setting minZoom after view is initialized. The line view.minZoom = 3; is commented out in the snippet because I tested both ways separately.

map = new Map({
    basemap: 'topo'
});

view = new MapView({
    container: id,
    map: map,
    center: [-100, 35],
    zoom: 4,
    minZoom: 3
});

// view.minZoom = 3;
view.ui.components = []; // toggles all default widgets off

Thank you,


D

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
YannCabon
Esri Contributor

Hi,

View constraints are now into a dedicated object.

MapView | API Reference | ArcGIS API for JavaScript

View solution in original post

2 Replies
YannCabon
Esri Contributor

Hi,

View constraints are now into a dedicated object.

MapView | API Reference | ArcGIS API for JavaScript

TyroneBiggums
Occasional Contributor III

Good call. My syntax for anyone else (or if someone else wants to advise a more efficient way):

view = new MapView({

     constraints: {

          minZoom: 3

     }

});

0 Kudos