pa7 / heatmap.js

🔥 JavaScript Library for HTML5 canvas based heatmaps
https://www.patrick-wied.at/static/heatmapjs/
MIT License
6.24k stars 1.33k forks source link

ImageData data assignment in Strict Mode #314

Open eliorar opened 4 years ago

eliorar commented 4 years ago

img.data = imgData // this line is not working in strict mode (line 527 heatmap.js); this.ctx.putImageData(img, x, y); this._renderBoundaries = [1000, 1000, 0, 0]; the error is as follows: TypeError: Cannot assign to read only property 'data' of #<ImageData>

Possible solution: according to documentation: https://developer.mozilla.org/en-US/docs/Web/API/ImageData you should use only putImageData function, so removing img.data = imgData resolves the issue

raycrummey commented 4 years ago

fixed in Pull Request #315. img.data is being mutated by changes to imgData.

muyao1987 commented 2 years ago

You can use this bug-fixed version:npm install @mars3d/heatmap.js

Corresponding source address: https://github.com/muyao1987/heatmap.js

mars3d update

hankun8645 commented 1 year ago

leaflet.js You can use this bug-fixed version:npm install keli-heatmap.js

Corresponding source address: https://www.npmjs.com/package/keli-heatmap.js