diff --git a/examples/heatmap-earthquakes.html b/examples/heatmap-earthquakes.html index 1f6a294198..d6ec6f8899 100644 --- a/examples/heatmap-earthquakes.html +++ b/examples/heatmap-earthquakes.html @@ -29,7 +29,7 @@
-
+

Earthquakes heatmap

Demonstrates the use of a heatmap layer.

@@ -40,8 +40,15 @@
heatmap, kml, vector, style
-
+
+
+ + +
+
+ +
diff --git a/examples/heatmap-earthquakes.js b/examples/heatmap-earthquakes.js index e28ce927b1..0e41408931 100644 --- a/examples/heatmap-earthquakes.js +++ b/examples/heatmap-earthquakes.js @@ -5,6 +5,7 @@ goog.require('ol.layer.Tile'); goog.require('ol.source.KML'); goog.require('ol.source.Stamen'); +var radius = $('#radius'); var vector = new ol.layer.Heatmap({ source: new ol.source.KML({ @@ -12,7 +13,7 @@ var vector = new ol.layer.Heatmap({ projection: 'EPSG:3857', url: 'data/kml/2012_Earthquakes_Mag5.kml' }), - radius: 5 + radius: parseInt(radius.val(), 10) }); vector.getSource().on('addfeature', function(event) { @@ -38,3 +39,8 @@ var map = new ol.Map({ zoom: 2 }) }); + + +radius.on('input', function() { + vector.setRadius(parseInt(radius.val(), 10)); +});