I'm trying to dynamically update the extent of a 500px x 400px map such that the view contains all of Corsica and Sardinia (an artificial example). (See codepen https://codepen.io/tonygraham/pen/eYKYLqX).
However, the resulting view clips the region that I expected to see, and neither Corsica nor Sardinia "fits".
Am I missing some subtlety with scale or zoom? Should I be setting those as well?
My real use case is that I have some projected data already graphed that I want to display above the map at an exact extent, but I think I'm lacking the control I need over the extent to do it.
Solved! Go to Solution.
@TonyGraham - By default the MapView will snap to the LODs. You can turn that off, and it should zoom to the exact extent you set.
constraints: {
snapToZoom: false
}
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints
@TonyGraham - By default the MapView will snap to the LODs. You can turn that off, and it should zoom to the exact extent you set.
constraints: {
snapToZoom: false
}
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints