Select to view content in your preferred language

Restrict map panning to provided extent

1455
2
Jump to solution
04-06-2023 12:26 PM
patryks
Emerging Contributor

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?

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Honored Contributor
A useful feature of the Views in the ArcGIS API for JavaScript is the ability to apply constraints. That could be scale or even geometry constraints! Let's take a look! 🚀Demo App🚀 https://stackblitz.com/edit/vitejs-vite-arcgis-v1-view-constraints 🎙️The Bounding Box🎙️ https://odoe.net/podcast ...
2 Replies
ReneRubalcava
Honored Contributor
A useful feature of the Views in the ArcGIS API for JavaScript is the ability to apply constraints. That could be scale or even geometry constraints! Let's take a look! 🚀Demo App🚀 https://stackblitz.com/edit/vitejs-vite-arcgis-v1-view-constraints 🎙️The Bounding Box🎙️ https://odoe.net/podcast ...
patryks
Emerging Contributor

Works perfectly! Thank you!

0 Kudos