Disable zoom/pan when selecting point

4130
11
06-18-2010 09:04 AM
BradleyMontgomery
New Contributor II
This has probably been addressed somewhere but I wasn't able to find it. Anyway, I have a custom widget that allows a user to select a point and then pop up a bunch of data about the point from related tables. It all works great except that the map navigation tools are still enabled when the user is selecting the point. If the zoom tool had been previously selected, when the user clicks on the point they want, the map zooms in. If pan has been selected and the user just happens to hold down the mouse for a few milliseconds and moves it while selecting the point, the map pans. I've tried disabling the navigation toolbar as in:

var navToolbar:Navigation;
navToolbar = new Navigation();
navToolbar.map = map;
navToolbar.deactivate();

And then selecting the point as in:

setMapAction(Draw.MAPPOINT, status, drawEnd);

But the navigation tools are still active. How do I turn them off?

Thanks!
Tags (2)
11 Replies
RobertScheitlin__GISP
MVP Emeritus
Charlie,

   OK now I see what you are talking about. That is the new default behavior of the AGS Flex API 1.3. It allows you to pan the map while having a draw tool activated so you don't have to switch tools all the time. Yes, several people are upset about this new default.
0 Kudos
DasaPaddock
Esri Regular Contributor
The workaround is to set myMap.panEnabled to false after you activate the Draw tool.
See: http://forums.esri.com/Thread.asp?c=158&f=2421&t=299768#936563

You can test this by adding this line after the switch in the DrawToolbar sample:
    myMap.panEnabled = false;

DrawToolbar sample:
http://resources.esri.com/help/9.3/arcgisserver/apis/flex/samples/index.html?sample=DrawToolbar