I have created an OpenLayers 3 heatmap. Because my weight column is not in the range 0-1, I need to use a function to divide it by the maximum value (which I know). I am doing the following:
var lyr_airports = new ol.layer.Heatmap({
source:jsonSource_airports,
radius: 20,
weight: function(){'ELEV'/1569},
title: "airports"
});
Is that correct? In other words, does it recognize column names like that in the function, or do I need to reference the column fully? If the latter (in this example), how?
Edit
Just spotted a horribly basic error: no return
. Will fix that and retest.
Best Answer
The weight function takes a feature as an attribute (Code can be found on GitHub). You can use it like that: