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-bounds/td-p/350982
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?
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!
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.