Select to view content in your preferred language

Extent

952
7
12-20-2018 02:05 AM
irtizahussain
Regular Contributor

I want to fix the zoom out extend , in my code zoom in extend is working fine but i want to set zoom out extend as well.

this is the code where min is fine but max is not working !!

zoom: 5,
constraints: {
altitude: {
min: 100,  //for zoom in
max: 10210  //for zoom out
}

0 Kudos
7 Replies
irtizahussain
Regular Contributor

Where i'm using MapView, 4x version in my project.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Irtiza,

   Not sure how you can up with the altitude property in the constraints for a MapView. Altitude is only for a SceneView.

Here is how you set the min and max scale for a MapView:

view.constraints = {
  minScale: 500000,  // User cannot zoom out beyond a scale of 1:500,000
  maxScale: 0  // User can overzoom tiles
};
irtizahussain
Regular Contributor

Sir, this is not working on my project.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Irtiza,

  I would have to see how you added that to your code then, because that works fine for me.

0 Kudos
irtizahussain
Regular Contributor

sir i already posted the code above which i used to set extend.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

I am asking you to post your full code after my suggested code change. You have to have something wrong in your code.

0 Kudos
Noah-Sager
Esri Regular Contributor

irtiza hussain what Robert posted is correct. The 2D MapView does not contain an altitude property. Please refer to the documentation here:

MapView | API Reference | ArcGIS API for JavaScript 4.10 

However, if you are working with a 3D SceneView, then your code looks fine to me. Here is an example app showing what I think you are trying to accomplish:

SceneView Constraints 

Do you see any errors in the browser console? Please feel free to refer to the relevant documentation here:

SceneView | API Reference | ArcGIS API for JavaScript 4.10