Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1009 Bytes

map-controller.md

File metadata and controls

43 lines (30 loc) · 1009 Bytes

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}
onViewportChange={v => this.setState({viewport: v})}
/>

Use with multiple views:

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

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

For a list of supported options, see Controller.

Source

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