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...
2 Answers 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);
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– lintmouse2014年06月10日 17:34:00 +00:00Commented Jun 10, 2014 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– lintmouse2014年06月11日 16:42:44 +00:00Commented Jun 11, 2014 at 16:42