Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@deck.gl/geo-layers

Package Overview
Dependencies
Maintainers
5
Versions
405
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deck.gl/geo-layers

deck.gl layers supporting geospatial use cases and GIS formats

  • 9.0.38
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
158K
increased by16.32%
Maintainers
5
Weekly downloads
 
Created

What is @deck.gl/geo-layers?

@deck.gl/geo-layers is a collection of layers for geospatial visualization built on top of deck.gl. It provides specialized layers for rendering geospatial data, such as polygons, paths, and points, with support for various data formats and sources.

What are @deck.gl/geo-layers's main functionalities?

H3HexagonLayer

The H3HexagonLayer is used to visualize data aggregated into hexagonal grids using the H3 spatial indexing system. This example demonstrates how to create a hexagon layer with elevation and color based on data values.

const {DeckGL} = require('@deck.gl/react');
const {H3HexagonLayer} = require('@deck.gl/geo-layers');

const layer = new H3HexagonLayer({
  id: 'h3-hexagon-layer',
  data: 'https://raw.githubusercontent.com/uber-common/deck.gl-data/master/website/sf.h3cells.json',
  pickable: true,
  extruded: true,
  elevationScale: 1000,
  getHexagon: d => d.hexagon,
  getFillColor: d => [255, (1 - d.count / 5000) * 255, 0],
  getElevation: d => d.count
});

const deckgl = new DeckGL({
  initialViewState: {
    longitude: -122.4,
    latitude: 37.74,
    zoom: 11,
    pitch: 30,
    bearing: 0
  },
  controller: true,
  layers: [layer]
});

TileLayer

The TileLayer is used to render raster tiles from a tile server. This example demonstrates how to create a tile layer using OpenStreetMap tiles.

const {DeckGL} = require('@deck.gl/react');
const {TileLayer} = require('@deck.gl/geo-layers');

const layer = new TileLayer({
  data: 'https://c.tile.openstreetmap.org/{z}/{x}/{y}.png',
  minZoom: 0,
  maxZoom: 19,
  tileSize: 256,
  renderSubLayers: props => {
    const {tile} = props;
    return new BitmapLayer(props, {
      data: null,
      image: tile.data,
      bounds: tile.bbox
    });
  }
});

const deckgl = new DeckGL({
  initialViewState: {
    longitude: -122.4,
    latitude: 37.74,
    zoom: 11,
    pitch: 30,
    bearing: 0
  },
  controller: true,
  layers: [layer]
});

TripsLayer

The TripsLayer is used to visualize vehicle trips along a path over time. This example demonstrates how to create a trips layer with animated paths.

const {DeckGL} = require('@deck.gl/react');
const {TripsLayer} = require('@deck.gl/geo-layers');

const layer = new TripsLayer({
  id: 'trips-layer',
  data: 'https://raw.githubusercontent.com/uber-common/deck.gl-data/master/examples/trips/trips-v7.json',
  getPath: d => d.path,
  getTimestamps: d => d.timestamps,
  getColor: [253, 128, 93],
  opacity: 0.8,
  widthMinPixels: 2,
  rounded: true,
  trailLength: 180,
  currentTime: 100
});

const deckgl = new DeckGL({
  initialViewState: {
    longitude: -122.4,
    latitude: 37.74,
    zoom: 11,
    pitch: 30,
    bearing: 0
  },
  controller: true,
  layers: [layer]
});

Other packages similar to @deck.gl/geo-layers

Keywords

FAQs

Package last updated on 11 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc