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
Solved! Go to Solution.
Hi,
View constraints are now into a dedicated object.
Hi,
View constraints are now into a dedicated object.
Good call. My syntax for anyone else (or if someone else wants to advise a more efficient way):
view = new MapView({
constraints: {
minZoom: 3
}
});