Skip to content
A suite of 3D-enabled data editing overlays, suitable for deck.gl
TypeScript JavaScript Shell
Branch: master
Clone or download

Latest commit

Latest commit e3cb5bc Jun 16, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE delete github workflows Dec 2, 2019
dev-docs/RFCs/v1.0 feat: better prettier support (#403) May 15, 2020
docs docs: fix selection-layer doc (#404) May 19, 2020
examples v0.18.5 Jun 16, 2020
modules v0.18.5 Jun 16, 2020
scripts Typescript migration (#377) Apr 9, 2020
static Initial gatsby website structure (#186) Mar 22, 2019
test eslintrc ignore import extensions Jun 5, 2018
website feat: better prettier support (#403) May 15, 2020
.eslintignore Typescript migration (#377) Apr 9, 2020
.eslintrc.js De-structure coordinates prop to avoid passing to the `div` (#379) May 19, 2020
.gitattributes Create @nebula.gl/overlays (#182) Mar 18, 2019
.gitignore Typescript migration (#377) Apr 9, 2020
.prettierignore docs: fix selection-layer doc (#404) May 19, 2020
.travis.yml Typescript migration (#377) Apr 9, 2020
CHANGELOG.md v0.18.4 Changelog May 11, 2020
LICENSE Initial release Jun 4, 2018
README.md Update README.md Apr 21, 2020
babel.config.js Typescript migration (#377) Apr 9, 2020
jest.config.js react-map-gl-draw: use nebula.gl/edit-modes (#376) Apr 20, 2020
lerna.json v0.18.5 Jun 16, 2020
package.json fix publish script (#405) May 19, 2020
prettier.config.js Typescript migration (#377) Apr 9, 2020
publish-docs.sh scripts for version update taking into consideration all modules (#86) Sep 24, 2018
tsconfig.json edit-modes: support shape property for circles and rectangles (#375) Apr 20, 2020
yarn.lock feat: better prettier support (#403) May 15, 2020

README.md

version version

version version version

build coveralls

nebula.gl | Website

An editing framework for deck.gl

docs

nebula.gl provides editable and interactive map overlay layers, built using the power of deck.gl.

Getting started

Running the example

  1. git clone git@github.com:uber/nebula.gl.git
  2. cd nebula.gl
  3. yarn
  4. cd examples/advanced
  5. yarn
  6. export MapboxAccessToken='<Add your key>'
  7. yarn start-local
  8. You can now view and edit geometry.

Installation

yarn add @nebula.gl/layers
yarn add @nebula.gl/overlays
yarn add @deck.gl/core
yarn add @deck.gl/react
yarn add @deck.gl/layers

EditableGeoJsonLayer

EditableGeoJsonLayer is implemented as a deck.gl layer. It provides the ability to view and edit multiple types of geometry formatted as GeoJSON (an open standard format for geometry) including polygons, lines, and points.

import DeckGL from 'deck.gl';
import { EditableGeoJsonLayer, DrawPolygonMode } from 'nebula.gl';

const myFeatureCollection = {
  type: 'FeatureCollection',
  features: [
    /* insert features here */
  ]
};

const selectedFeatureIndexes = [];

class App extends React.Component {
  state = {
    data: myFeatureCollection
  };

  render() {
    const layer = new EditableGeoJsonLayer({
      id: 'geojson-layer',
      data: this.state.data,
      mode: DrawPolygonMode,
      selectedFeatureIndexes,

      onEdit: ({ updatedData }) => {
        this.setState({
          data: updatedData,
        });
      }
    });

    return <DeckGL {...this.props.viewport} layers={[layer]} />;
  }
}

CodeSandbox

You can’t perform that action at this time.