Select to view content in your preferred language

How to restrict map to navigate other countries

1147
3
06-15-2017 01:49 AM
Surajit_Kr_Saha
Deactivated User

My default location is UK. Client don't want to navigate map to other countries. Is it possible to restrict map to one country? 

0 Kudos
3 Replies
MirHashmi
Frequent Contributor

Hi. A similar question was answered here on geonet

0 Kudos
JeffBigos
Esri Contributor

Hi Surajit,

If you are using the 3.x version of the api you can set the starting extent of the map using the extent property when creating the instance of the map.

After the map has loaded you can disable the map navigation as outlined in the following reference guide:

Map navigation | Guide | ArcGIS API for JavaScript 3.20 

Hope this helps.

Jeff

0 Kudos
HemingZhu
Frequent Contributor

I had situation what i have to control my map display with a certain area (D.C for example). my approach is watch the view's extend against your restricted extent ( in API 3.1 it will be map's extent-change event). if the new extent is out, move view (or map in 3.x) back to its previous center. Let me know...

0 Kudos