Class: Navigation

Description

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

Toolbar that supports basic navigation such as pan and zoom.

Samples

Search for samples that use this class.  

Class hierarchy

esri.toolbars.Navigation

Constructor

Constructor Description
esri.toolbars.Navigation(map) Creates a new Navigation object. A Map is a required parameter.

Constants

Constant Description
PAN Map is panned.
ZOOM_IN Map zooms in.
ZOOM_OUT Map zooms out.

Methods

Method Return Value Description
activate(navType) none Activates the toolbar for map navigation. Activating the toolbar overrides default map navigation.
deactivate() none Deactivates the toolbar and reactivates map navigation.
isFirstExtent() Boolean When "true", map is at the first extent.
isLastExtent() Boolean When "true", map is at the last extent.
setZoomSymbol(symbol) none Set the SimpleFillSymbol used for the rubber band zoom.
zoomToFullExtent() none Zoom to full extent of base layer.
zoomToNextExtent() none Zoom to next extent in extent history.
zoomToPrevExtent() none Zoom to previous extent in extent history.

Events

Event Description
onExtentHistoryChange() Fires when the extent history changes.
Constructor Detail

esri.toolbars.Navigation(map)

Creates a new Navigation object. A Map is a required parameter.
Parameters:
<Map> map Required Map the toolbar is associated with.
Code snippets:
navToolbar = new esri.toolbars.Navigation(map);
Methods Detail

activate(navType)

Activates the toolbar for map navigation. Activating the toolbar overrides default map navigation.
Return value: none
Input Parameters:
<String> navType Required The navigation type. The Constants table lists valid navigation values.

deactivate()

Deactivates the toolbar and reactivates map navigation.
Return value: none

isFirstExtent()

When "true", map is at the first extent.
Return value: Boolean
Code snippets:
 dijit.byId("zoomprev").disabled = navToolbar.isFirstExtent();

isLastExtent()

When "true", map is at the last extent.
Return value: Boolean
Code snippets:
 dijit.byId("zoomnext").disabled = navToolbar.isLastExtent();

setZoomSymbol(symbol)

Set the SimpleFillSymbol used for the rubber band zoom.
Return value: none
Input Parameters:
<Symbol> symbol Required The SimpleFillSymbol used for the rubber band zoom.
Code snippets:
        navToolbar = new esri.toolbars.Navigation(map);
        navToolbar.setZoomSymbol(zoomSymbol);

zoomToFullExtent()

Zoom to full extent of base layer.
Return value: none

zoomToNextExtent()

Zoom to next extent in extent history.
Return value: none

zoomToPrevExtent()

Zoom to previous extent in extent history.
Return value: none

Events Detail

onExtentHistoryChange()

Fires when the extent history changes.
Code snippets:
function init{
  navToolbar = new esri.toolbars.Navigation(map);
  dojo.connect(navToolbar, "onExtentHistoryChange", extentHistoryChangeHandler);
}
function extentHistoryChangeHandler() {
  dijit.byId("zoomprev").disabled = navToolbar.isFirstExtent();
  dijit.byId("zoomnext").disabled = navToolbar.isLastExtent();
}