Skip to content

Commit

Permalink
Leaflet#43 crude patch that fixes intensity bug, probably creates pro…
Browse files Browse the repository at this point in the history
…blem 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.
  • Loading branch information
spacemansteve committed Mar 31, 2016
1 parent cede898 commit ca1f430
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/HeatLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit ca1f430

Please sign in to comment.