0

I want to enable the rubberband zoom effect without users having to hold the shift key down. This behavior is found is Esri navigation bar dijit. I don't want to use the dijit.

How can I get a zoom in/out bounding box to draw without forcing users to use shift key?

2
  • How will you distinguish between this and panning? Commented Sep 12, 2013 at 3:09
  • i would have buttons on a nav bar that the user could use to toggle between them. i just want to build a custom nav bar.
    – melo
    Commented Sep 12, 2013 at 13:30

1 Answer 1

1

I completely misread the docs. Here is the solution:

The zoom in/out is handled by the navigation class. This includes the ability to draw a rubberband box. You can design your own toolbar, you just need the navigation object in your code.

Add to the top of js:

dojo.require("esri.toolbars.navigation");
var navToolbar;

Add to the init function:

navToolbar = new esri.toolbars.Navigation(map);

Create a listener for the button of your choice, and include this:

navToolbar = new esri.toolbars.Navigation(map); 
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.