Leaflet / Leaflet.heat

A tiny, simple and fast heatmap plugin for Leaflet.
http://leaflet.github.io/Leaflet.heat/demo
BSD 2-Clause "Simplified" License
1.55k stars 525 forks source link

Bug: Heat map created is not what one expects #70

Open achourasia opened 8 years ago

achourasia commented 8 years ago

There seems to be bug in heat map generation. For example there are five points with different weights and a defined color gradient. Expected output must be these points with different colors, yet the out shows same color for each point.

Below is the example code which generates incorrect output `var map = L.map('map').setView([43.46811941, -90.04569087], 5);

var tiles = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(map);

addressPoints = [[42.35810000, -71.06360000, 10.3], [42.82995815, -74.78991444, 0.4], [43.17929819, -78.56603306, 0.5], [43.40320216, -82.37774519, 0.6], [43.49975489, -86.20965845, 0.7], [43.46811941, -90.04569087, 0.8],];

var heat = L.heatLayer(addressPoints, {minOpacity:1, blur:0, max: 1.0}).addTo(map);`

Please see the following fiddles Fiddle with incorrect output using heat_map.js: https://jsfiddle.net/y20js9nm/13/ Fiddle with correct output using heatmap.js: https://jsfiddle.net/pz4usuLe/40/ (had problems with loading external js) Fiddle with correct output using heatmap.js: https://jsfiddle.net/pz4usuLe/43/ (Fixed)

achourasia commented 8 years ago

Fixed the JS fiddle that shows correct output with heatmap.js https://jsfiddle.net/pz4usuLe/43/ The Javascript was not loading correctly. I suggest reopening this issue, as this seems to be major bug

ispmarin commented 7 years ago

So what´s the recommended heatmap to be used?

aysunakarsu commented 6 years ago

Hello, I am using heatmap plugin of folium and it is generating incorrect output by ignoring the weights of the locations. As I understand it is due to underlying js which is not loading correctly and ignoring weights. I will appreciate if someone can suggest a workaround. Thanks

seblaz commented 6 years ago

Any updates on this?

DavidMaer commented 5 years ago

Hello I'm using heatmap plugin of folium in python. And it is generating an incorrect map by ignoring the weights. How couldI fix this problem in Python?