Select to view content in your preferred language

How to limit how far in the user can zoom with the Navigation control

702
3
11-20-2011 03:23 PM
CharlotteCrawford
Emerging Contributor
Hi all,

I am trying to figure out how to limit how far in the user can zoom.  I believe it is something to do with the map resolution, is this correct?  How would I set it up so that the user can only zoom in to half the distance that they can by default?

Thanks
CC
0 Kudos
3 Replies
SanajyJadhav
Deactivated User
I am assuming you want to put constraint on the map extent.

You can look at 'Constrain Extent Behavior' sample to do this.Here is the documentation for the same.

Hope this helps.
0 Kudos
DominiqueBroux
Esri Frequent Contributor

I am trying to figure out how to limit how far in the user can zoom. I believe it is something to do with the map resolution, is this correct?

Right. you have to set or increase the minimum resolution of the map.

If your map has already a minimum resolution (that's the case if your map contains a tiled layer), you can use code like this one to increase it:
 
public MainPage()
{
  InitializeComponent();
  MyMap.Layers.LayersInitialized += ChangeMapResolution;
}
void ChangeMapResolution(object sender, System.EventArgs args)
{
  MyMap.MinimumResolution *= 2;
}
0 Kudos
CharlotteCrawford
Emerging Contributor
Thanks very much, I'll try it

CC
0 Kudos