Chevron DownAPI Reference

MapController

Inherits from Base Controller.

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

MapController is the default controller for MapView.

Usage

Use with the default view:

import DeckGL, {MapController} from 'deck.gl';

<DeckGL
controller={{type: MapController, dragRotate: false}}
viewState={viewState}
onViewStateChange={v => this.setState({viewState: v.viewState})}
/>

Use with multiple views:

import DeckGL, {MapView} from 'deck.gl';

<DeckGL
views={[
  new MapView({
    controller: {doubleClickZoom: false}
  })
]}
viewState={viewState}
onViewStateChange={v => this.setState({viewState: v.viewState})}
/>

For a list of supported options, see Controller.

Source

modules/core/src/controllers/map-controller.js