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

mapboxgl-heatmap

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mapboxgl-heatmap

Rudamentary MapBoxGL Plugin to add ability to add a heatmap

  • 0.1.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

This module uses the webgl-heatmap from https://github.com/pyalot/webgl-heatmap. This adds a Canvas element and overlays that on top of a mapbox-gl map.

The heatmap will reset on map state change.

usage:


var mapboxgl_heatmap = require('mapboxgl-heatmap');
var heatmap;

function msgRec(msg) {
    var latlng = new mapboxgl.LatLng(msg.lat, msg.lng);
    var point = map.project(latlng);
    heatmap.addPoint(point.x, point.y, 25, 0.5);
}

mapboxgl.accessToken = 'pk.enter-your-access-token-here';

map = new mapboxgl.Map({
    container: 'map',
    style: 'https://www.mapbox.com/mapbox-gl-styles/styles/outdoors-v6.json',
    center: [37.830348, -95.486052],
    zoom: 4
});

// Add heatmap to the map
heatmap = mapboxgl_heatmap.heatmap(map);

// Add zoom and rotation controls to the map.
map.addControl(new mapboxgl.Navigation());

//bootstrap web socket
webSocket.on('data', msgRec);


FAQs

Package last updated on 20 Nov 2014

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