Map navigationE-mail This Topic Printable Version Give Us Feedback

Users can choose the mouse, keyboard, and sliders for panning and zooming a map, depending on what is enabled in the HTML page. By default, users can do the following:

You can disable any of these options by using one of several Map methods. The following table lists:


Methods Property Description
enablePan(), disablePan() isPan When enabled, users can pan the map using the mouse.
  • Drag the mouse to pan
enableScrollWheelZoom(), disableScrollWheelZoom() isScrollWheelZoom When enabled, users can use the mouse scroll wheel to zoom in and out.
  • Mouse Scroll Forward to zoom in
  • Mouse Scroll Backward to zoom out
enableRubberBandZoom(), disableRubberBandZoom() isRubberBandZoom When enabled, users can draw a bounding box to zoom in or out from the map using the mouse.
  • SHIFT + Drag the mouse to zoom in
  • SHIFT + CTRL + Drag the mouse to zoom out
enableClickRecenter(), disableClickRecenter() isClickRecenter When enabled, users can double click on a map to recenter and zoom in a level.
  • SHIFT + Click to recenter
enableDoubleClickZoom(), disableDoubleClickZoom() isDoubleClickZoom When enabled, users can double click on a map to recenter and zoom in a level.
  • Double Click to Center and Zoom in
enableShiftDoubleClickZoom(), disableShiftDoubleClickZoom() isShiftDoubleClickZoom When enabled, users can shift + double click on a map to recenter and zoom in a level.
  • SHIFT + Double Click to Center and Zoom in
enableKeyboardNavigation(), disableKeyboardNavigation() isKeyboardNavigation When enabled, users can pan using the arrow keys and zoom using the + and - keys on the keyboard.
  • Use arrow keys to pan
  • Use + key to zoom in a level
  • Use - key to zoom out a level
showPanArrows(), hidePanArrows() isPanArrows Shows or hides the pan arrows on the map.
showZoomSlider(), hideZoomSlider() isZoomSlider Shows or hides the zoom slider on the map.
enableMapNavigation(), disableMapNavigation() none Enables or disables all map navigation except the pan arrows and slider.

Additional panning options

In addition to methods and properties related to mouse and keyboard operations, methods are also available to pan and center the map based on user input or code driven. Methods available for panning in this matter are:

You do not need to use these pan methods for the default pan arrows on the map since the pan functions are already built in. However, if you need to create a custom pan operation, these methods are available to you.

Additional centering options

You can programmatically recenter a map based on user input using the centerAt() and panTo() methods.

Depending on your application, you can decide if it is easier to work in screen or map coordinates.

These methods are in addition to the Shift + Click option available to users for recentering a map.