diff --git a/examples/heatmap/main.js b/examples/heatmap/main.js index 17b3e04bd8..8b5cd5945a 100644 --- a/examples/heatmap/main.js +++ b/examples/heatmap/main.js @@ -5,10 +5,10 @@ $(function () { var map = geo.map({ node: '#map', center: { - x: -122.445, - y: 37.8 + x: -98, + y: 39 }, - zoom: 6 + zoom: 3 }); $.ajax('https://s3.amazonaws.com/uploads.hipchat.com/446632/3114847/4dZfl0YfZpTfYzq/AdderallCities2015.csv', { @@ -32,10 +32,14 @@ $(function () { y: d[1] }; }) - .maxIntensity(20) - .style('radius', 15) + .style('radius', 10) .style('blurRadius', 30) - .style('opacity', 1.0); + .style('opacity', 1.0) + .style('color', + {0: {r: 0, g: 0, b: 0, a: 0.0}, + 0.25: {r: 0, g: 1, b: 0, a: 0.5}, + 0.5: {r: 1, g: 1, b: 0, a: 0.8}, + 1: {r: 1, g: 0, b: 0, a: 1.0}}); map.draw(); } }); diff --git a/src/canvas/heatmapFeature.js b/src/canvas/heatmapFeature.js index a887b606ba..c25ccc8181 100644 --- a/src/canvas/heatmapFeature.js +++ b/src/canvas/heatmapFeature.js @@ -139,7 +139,7 @@ var canvas_heatmapFeature = function (arg) { //////////////////////////////////////////////////////////////////////////// this._renderOnCanvas = function (context2d, map) { var data = m_this.data() || [], - radius = m_this.style('radius'), + radius = m_this.style('radius') + m_this.style('blurRadius'), pos, intensity, canvas, pixelArray; m_this._createCircle(); m_this._computeGradient();