1

I am using the ArcGIS API for Javascript and am wondering if it comes with functionality for zooming out using a rectangle, similar to the behavior in ArcGIS Desktop? Specifically, the user draws a rectangle and it zooms out based on that rectangle.

I can create the functionality myself, but was wondering if it already existed in the API...

0

The API has a Navigation toolbar class that uses this functionality.

It comes with a zoom out tool that works by drawing a box.

There is a sample page here.

  • Cool, thanks. Do you know if I need to use their toolbar to get that functionality, or can I just use the functionality in my own UI? – lintmouse Jun 10 '14 at 17:34
  • Thanks. I tinkered around and was able to use the navigation API without using any of the DOJO UI stuff. Did the trick! – lintmouse Jun 11 '14 at 16:42
2

Yes, it is built into the API. You just need to set up a navigation controller first:

navController = new esri.toolbars.navigation(yourMap)
navController.activate(Navigation.ZOOM_OUT);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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