Socket
Socket
Sign inDemoInstall

leaflet.sentimentheat

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    leaflet.sentimentheat

A Leaflet heatmap plugin.


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Leaflet.heat

A fork of Leaflet.heat that allows for an additional field for positive and negative values, for e.g. a sentiment heatmap

Basic Usage

var heat = L.heatLayer([
	[50.5, 30.5, 0.2, 1], // lat, lng, intensity, layer (1 for positive, 0 for neutral, -1 for negative)
	[50.6, 30.4, 0.5, 0],
	[50.7, 30.3, 0.3, -1],
	...
], {radius: 25}).addTo(map);

To include the plugin, just use leaflet-heat.js from the dist folder:

<script src="leaflet-heat.js"></script>

Building

To build the dist files run: npm install && npm run prepublish

Reference

L.heatLayer(latlngs, options)

Constructs a heatmap layer given an array of points and an object with the following options:

  • minOpacity - the minimum opacity the heat will start at
  • maxZoom - zoom level where the points reach maximum intensity (as intensity scales with zoom), equals maxZoom of the map by default
  • max - maximum point intensity, 1.0 by default
  • radius - radius of each "point" of the heatmap, 25 by default
  • blur - amount of blur, 15 by default
  • gradient - color gradient config, e.g. {0.4: 'blue', 0.65: 'lime', 1: 'red'}
  • autoMax - automatically compute the max value based on the current map frame

Each point in the input array can be either an array like [50.5, 30.5, 0.5], or a Leaflet LatLng object.

Optional third argument in each LatLng point (altitude) represents point intensity. Unless max option is specified, intensity should range between 0.0 and 1.0.

Methods
  • setOptions(options): Sets new heatmap options and redraws it.
  • addLatLng(latlng): Adds a new point to the heatmap and redraws it.
  • setLatLngs(latlngs): Resets heatmap data and redraws it.
  • redraw(): Redraws the heatmap.

Changelog

0.1.1 — April 18, 2017
  • Initial release.

Keywords

FAQs

Last updated on 18 Apr 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc