const vector = newHeatmapLayer({ source: newVectorSource({ url: 'data/kml/2012_Earthquakes_Mag5.kml', format: newKML({ extractStyles: false, }), }), blur: parseInt(blur.value, 10), radius: parseInt(radius.value, 10), weight: function (feature) { // 2012_Earthquakes_Mag5.kml stores the magnitude of each earthquake in a // standards-violating <magnitude> tag in each Placemark. We extract it from // the Placemark's name instead. const name = feature.get('name'); const magnitude = parseFloat(name.substr(2)); return magnitude - 5; }, });