heatmap.js icon indicating copy to clipboard operation
heatmap.js copied to clipboard

Bug calculating LocalExtreme in leaflet-heatmap.js

Open LePew opened this issue 8 years ago • 2 comments

Hi. I noticed a bug in leafleat-heatmap.js, when useLocalExtrema=true, localMin is bounded to 0, even if the real local minimal value is >0. At the beginning of the loop, localMin should be initialized to localMax, not 0;

Workaround: Line 117: var localMin; // don't initialize localMin to 0 then from L131: // local max is the maximum within current bounds localMax = Math.max(value, localMax); if(localMin==undefined){ // first initialization localMin=localMax; } else { //original code localMin = Math.min(value, localMin); }

LePew avatar Mar 13 '17 20:03 LePew

thanks @LePew for reporting, thought I have fixed that in the past, but I did not. will push a fix soon

pa7 avatar Mar 14 '17 01:03 pa7

This issue is biting me here in 2021.

jcn-ithaca avatar Jul 09 '21 19:07 jcn-ithaca