Skip to content

Commit

Permalink
cleanup alt handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Nov 25, 2014
1 parent 7f79ffe commit 6c88b34
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/HeatLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ L.HeatLayer = (L.Layer ? L.Layer : L.Class).extend({
x = Math.floor((p.x - offsetX) / cellSize) + 2;
y = Math.floor((p.y - offsetY) / cellSize) + 2;

var alt = isNaN(this._latlngs[i].alt) ? (isNaN(this._latlngs[i][2]) ? 1 : this._latlngs[i][2]) : this._latlngs[i].alt
var alt =
this._latlngs[i].alt !== undefined ? this._latlngs[i].alt :
this._latlngs[i][2] !== undefined ? +this._latlngs[i][2] : 1;
k = alt * v;

grid[y] = grid[y] || [];
Expand Down

0 comments on commit 6c88b34

Please sign in to comment.