Min/Max Zoom on view

5884
6
Jump to solution
11-10-2017 04:10 PM
NachiChidambaram
New Contributor II

I am trying to set the following properties on the view   (arcgis api 4.5)

effectiveMinZoom

effectiveMaxZoom.

So that I can set the max and min allowed zoom level .    For some reason I don't see any errors and the min and max zoom levels are not set.

I also tried minZoom and maxZoom. No luck

Here is my code :

var map = new Map({
            basemap: "hybrid"            
            });

           // map.add(transportationLyr);

        var view = new MapView({
            container: "viewDiv",  // Reference to the DOM node that will contain the view
            map: map,               // References the map object created in step 3
            zoom: 12,
            effectiveMaxZoom: 15,
            effectiveMinZoom: 10,
            center: [-82.78,35.0],
            padding:{
                right:320
                }
            });

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
NachiChidambaram
New Contributor II

This worked for me 

this.view.constraints = {
minZoom: 9
};

View solution in original post

6 Replies
RobertScheitlin__GISP
MVP Emeritus

Nachi,

  Looks like you need to be looking at view constraints. minScale and maxScale are properties of the constraints property of the MapView.

https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints 

0 Kudos
NachiChidambaram
New Contributor II

This worked for me 

this.view.constraints = {
minZoom: 9
};
RobertScheitlin__GISP
MVP Emeritus

Nachi,

   Glad to hear it. Don't forget to mark this question as answered by clicking the "Mark Correct" link on the reply that answered your question.

0 Kudos
NachiChidambaram
New Contributor II

Is it possible to show marker based on zoom level (something like as we zoom in more points are visible). 

So that they are not overlapping when zoom out too far and looks clean on map view ? 

0 Kudos
GuillaumeSPRIET
New Contributor

par contre 

0 Kudos
GuillaumeSPRIET
New Contributor

ça fonctionne ap

0 Kudos