From 948d40e4b58c099abbfb0f9d463dab743a4d136a Mon Sep 17 00:00:00 2001 From: Mateusz Juraszek Date: Fri, 31 Oct 2014 14:21:05 +0100 Subject: [PATCH 1/2] fix point intensity --- src/HeatLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HeatLayer.js b/src/HeatLayer.js index 8d1c988..6fb4f8c 100644 --- a/src/HeatLayer.js +++ b/src/HeatLayer.js @@ -141,7 +141,7 @@ L.HeatLayer = L.Class.extend({ x = Math.floor((p.x - offsetX) / cellSize) + 2; y = Math.floor((p.y - offsetY) / cellSize) + 2; - k = (this._latlngs[i].alt || 1) * v; + k = (this._latlngs[i][2] || 1) * v; grid[y] = grid[y] || []; cell = grid[y][x]; From 997ee85a3e636addeef6c9a8450780000c96fd47 Mon Sep 17 00:00:00 2001 From: Mateusz Juraszek Date: Mon, 3 Nov 2014 10:35:27 +0100 Subject: [PATCH 2/2] fix alt for Array of Arrays and Array of LatLngs usage --- src/HeatLayer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/HeatLayer.js b/src/HeatLayer.js index 6fb4f8c..52aa12f 100644 --- a/src/HeatLayer.js +++ b/src/HeatLayer.js @@ -141,7 +141,8 @@ L.HeatLayer = L.Class.extend({ x = Math.floor((p.x - offsetX) / cellSize) + 2; y = Math.floor((p.y - offsetY) / cellSize) + 2; - k = (this._latlngs[i][2] || 1) * v; + var alt = isNaN(this._latlngs[i].alt) ? (isNaN(this._latlngs[i][2]) ? 1 : this._latlngs[i][2]) : this._latlngs[i].alt + k = alt * v; grid[y] = grid[y] || []; cell = grid[y][x];