From f11755069424c73567229ecf2514c911f6064065 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 12 Feb 2015 14:20:49 +0100 Subject: [PATCH] Add a radius input to the heatmap-earthquakes example --- examples/heatmap-earthquakes.html | 11 +++++++++-- examples/heatmap-earthquakes.js | 8 +++++++- 2 files changed, 16 insertions(+), 3 deletions(-) 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)); +});