Skip to content

Commit

Permalink
Fixed bad offset for rendered primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
aashish24 committed Apr 14, 2016
1 parent 834ea03 commit 1c93bab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions examples/heatmap/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand All @@ -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();
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/canvas/heatmapFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1c93bab

Please sign in to comment.