Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/ui/public/vislib/visualizations/marker_types/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ define(function (require) {
HeatmapMarker.prototype.addLegend = _.noop;

HeatmapMarker.prototype._createMarkerGroup = function (options) {
var min = _.get(this.geoJson, 'properties.allmin');
var max = _.get(this.geoJson, 'properties.allmax');
var points = this._dataToHeatArray(max);
var points = this._dataToHeatArray(min, max);

this._markerGroup = L.heatLayer(points, options);
this._fixTooltips();
Expand Down Expand Up @@ -185,7 +186,7 @@ define(function (require) {
* @param max {Number}
* @return {Array}
*/
HeatmapMarker.prototype._dataToHeatArray = function (max) {
HeatmapMarker.prototype._dataToHeatArray = function (min, max) {
var self = this;
var mapData = this.geoJson;

Expand All @@ -199,7 +200,7 @@ define(function (require) {
heatIntensity = feature.properties.value;
} else {
// show bucket value normalized to max value
heatIntensity = parseInt(feature.properties.value / max * 100);
heatIntensity = parseInt((feature.properties.value - min) / (max - min) * 100);
}

return [lat, lng, heatIntensity];
Expand Down