Is there a way to block map panning to specified extent? I already implemented solution mentioned here:
https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-mapview-to-stay-within-bo...
http://jsfiddle.net/gh/gist/library/pure/6050806/
but this solution allows to move outside extent and navigates back. I wonder if is there a way to block panning itself so it cannot move outside extent?
Solved! Go to Solution.
Yes, you can use the View constraints
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints
Demo: https://stackblitz.com/edit/vitejs-vite-arcgis-v1-view-constraints?file=src%2Fmain.ts
Video: https://www.youtube.com/watch?v=4A6xGWusgN4&ab_channel=ReneRubalcava
Yes, you can use the View constraints
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints
Demo: https://stackblitz.com/edit/vitejs-vite-arcgis-v1-view-constraints?file=src%2Fmain.ts
Video: https://www.youtube.com/watch?v=4A6xGWusgN4&ab_channel=ReneRubalcava
Works perfectly! Thank you!