Chevron DownAPI Reference


Inherits from Base Controller.

The MapController class can be passed to either the Deck class's controller prop or a View class's controller prop to specify that map interaction should be enabled.

MapController is the default controller for MapView..


Use with the default view:

import {Deck} from '';

new Deck({
  controller: {doubleClickZoom: false, inertia: true},
  initialViewState: viewState

is equivalent to:

import {Deck} from '';

new Deck({
  views: new MapView({
    controller: {doubleClickZoom: false,  inertia: true}
  initialViewState: viewState


Supports all Controller options with the following default behavior:

  • dragMode - default 'pan' (drag to pan, shift/ctrl + drag to rotate)
  • keyboard - arrow keys to pan, arrow keys with shift/ctrl down to rotate, +/- to zoom
  • normalize - normalize viewport props to fit map height into viewport. Default true

Custom MapController

You can further customize the MapController's behavior by extending the class:

import {Deck, MapController} from '';

class MyMapController extends MapController {

  handleEvent(event) {
    if (event.type === 'pan') {
      // do something
    } else {

new Deck({
  controller: {type: MyMapController},
  initialViewState: viewState

See the Controller class documentation for the methods that you can use and/or override.