From ca1f43026545f7e413c653e376b1fa8bf3a2b6a6 Mon Sep 17 00:00:00 2001 From: Steve McDonald Date: Thu, 31 Mar 2016 10:26:29 -0400 Subject: [PATCH] #43 crude patch that fixes intensity bug, probably creates problem when intensity not present based on some code very kindly provided by github user jameslaneconkling. the code in L.heat that redraws the layers was multiplying intensities by a value related to the zoom level stored in a variable named v. v is typically a very small number, ranging from .008 to .00002. The code works better if it just uses the intensity value. Since I only provide points with an intensity value set, I'm not sure what happens when the intensity isn't set. The code probably breaks. This commit is not intended as a permanent fix. Instead, it highlights where the problem is. I hope someone that knows the code better considers re-organizing the render loop perhaps treating separating it into two distinct pieces: one for when intensities are provided and one where they are not. --- src/HeatLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HeatLayer.js b/src/HeatLayer.js index 455df17..d0e7cdc 100644 --- a/src/HeatLayer.js +++ b/src/HeatLayer.js @@ -145,7 +145,7 @@ L.HeatLayer = (L.Layer ? L.Layer : L.Class).extend({ var alt = this._latlngs[i].alt !== undefined ? this._latlngs[i].alt : this._latlngs[i][2] !== undefined ? +this._latlngs[i][2] : 1; - k = alt * v; + k = alt; grid[y] = grid[y] || []; cell = grid[y][x];