Skip to content

selection layer

Georgios Karnas edited this page Mar 21, 2019 · 1 revision

SelectionLayer

This layer can be used to select deck.gl objects using mouse drawing.

layers.push(
  new SelectionLayer({
    id: 'selection',
    selectionType: this.state.selectionTool,
    onSelect: ({ pickingInfos }) => {
      this.setState({ selectedFeatureIndexes: pickingInfos.map(pi => pi.index) });
    },
    layerIds: ['geojson'],

    getTentativeFillColor: () => [255, 0, 255, 100],
    getTentativeLineColor: () => [0, 0, 255, 255],
    getTentativeLineDashArray: () => [0, 0],
    lineWidthMinPixels: 3
  })
);

Properties

Inherits all deck.gl's Base Layer properties.

Also inherites some EditableGeoJsonLayer properties.

Note: do not pass a data property.

selectionType (String, required)

  • Default: null

SELECTION_TYPE.RECTANGLE or SELECTION_TYPE.POLYGON

onSelect (Function, required)

Called when selection is completed.

layerIds (String[], required)

Array of layer ids where we will search.

Sidebar

Clone this wiki locally