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

@deck.gl/google-maps

Package Overview
Dependencies
Maintainers
5
Versions
400
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deck.gl/google-maps

Use deck.gl as a custom Google Maps overlay

  • 9.0.38
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
154K
increased by21.23%
Maintainers
5
Weekly downloads
 
Created

What is @deck.gl/google-maps?

@deck.gl/google-maps is a package that integrates Deck.gl visualizations with Google Maps. It allows developers to create high-performance, WebGL-powered visualizations on top of Google Maps, leveraging the rich feature set of Deck.gl for rendering large-scale data sets.

What are @deck.gl/google-maps's main functionalities?

Overlay Deck.gl Layers on Google Maps

This feature allows you to overlay Deck.gl layers, such as a ScatterplotLayer, on a Google Map. The code sample demonstrates how to create a Google Maps instance and overlay a scatterplot layer on it.

const {GoogleMapsOverlay} = require('@deck.gl/google-maps');
const {ScatterplotLayer} = require('@deck.gl/layers');

const overlay = new GoogleMapsOverlay({
  layers: [
    new ScatterplotLayer({
      id: 'scatterplot-layer',
      data: [
        {position: [-122.45, 37.78], size: 100},
        {position: [-122.46, 37.76], size: 200}
      ],
      getPosition: d => d.position,
      getRadius: d => d.size,
      getColor: [255, 0, 0]
    })
  ]
});

const map = new google.maps.Map(document.getElementById('map'), {
  center: {lat: 37.78, lng: -122.45},
  zoom: 12
});

overlay.setMap(map);

Interactive Data Visualization

This feature enables interactive data visualization on Google Maps using Deck.gl layers. The code sample shows how to create a HexagonLayer that visualizes data with interactive tooltips on hover.

const {GoogleMapsOverlay} = require('@deck.gl/google-maps');
const {HexagonLayer} = require('@deck.gl/aggregation-layers');

const overlay = new GoogleMapsOverlay({
  layers: [
    new HexagonLayer({
      id: 'hexagon-layer',
      data: 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-bike-parking.json',
      getPosition: d => d.COORDINATES,
      radius: 1000,
      elevationScale: 4,
      extruded: true,
      pickable: true,
      onHover: ({object, x, y}) => {
        const tooltip = `${object.position.join(', ')}
Count: ${object.points.length}`;
        /* Show tooltip at (x, y) */
      }
    })
  ]
});

const map = new google.maps.Map(document.getElementById('map'), {
  center: {lat: 37.78, lng: -122.45},
  zoom: 12
});

overlay.setMap(map);

Other packages similar to @deck.gl/google-maps

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