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
}
Where i'm using MapView, 4x version in my project.
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
};
Sir, this is not working on my project.
Irtiza,
I would have to see how you added that to your code then, because that works fine for me.
sir i already posted the code above which i used to set extend.
I am asking you to post your full code after my suggested code change. You have to have something wrong in your code.
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:
Do you see any errors in the browser console? Please feel free to refer to the relevant documentation here: