Skip to content

Commit

Permalink
Use the weight stored in the item.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorix committed Mar 29, 2013
1 parent e121483 commit 2b9b542
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/heatmap-openlayers-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,23 +330,24 @@ OpenLayers.Renderer.Heatmap = OpenLayers.Class(OpenLayers.Renderer, {
this.map.baseLayer.wrapDateLine) &&
this.map.getMaxExtent();
var data = [],
max = 0,
item = 0,
weight,
getWeight = this.weight
getWeight = this.weight,
features = [];

// What is the layer?,
// we need to use all features although not in the map window.
for (var id in this.features) {
if (!this.features.hasOwnProperty(id)) { continue; }
feature = this.features[id][0];
item = this.features[id];
feature = item[0];
bounds = feature.geometry.getBounds();
this.calculateFeatureDx(bounds, worldBounds);
var pt = this.getLocalXY(bounds.getCenterLonLat());
var p0 = pt[0];
var p1 = pt[1];
if(!isNaN(p0) && !isNaN(p1)) {
weight = getWeight(feature); // TODO: use this.features[id][1]?
weight = item[1];
data.push({x: p0, y: p1, count: weight});
}
}
Expand Down

0 comments on commit 2b9b542

Please sign in to comment.