diff --git a/examples/heatmap-earthquakes.js b/examples/heatmap-earthquakes.js index 953f596946..05d28aeb31 100644 --- a/examples/heatmap-earthquakes.js +++ b/examples/heatmap-earthquakes.js @@ -43,11 +43,14 @@ const map = new Map({ }) }); - -blur.addEventListener('input', function() { +const blurHandler = function() { vector.setBlur(parseInt(blur.value, 10)); -}); +}; +blur.addEventListener('input', blurHandler); +blur.addEventListener('change', blurHandler); -radius.addEventListener('input', function() { +const radiusHandler = function() { vector.setRadius(parseInt(radius.value, 10)); -}); +}; +radius.addEventListener('input', radiusHandler); +radius.addEventListener('change', radiusHandler); diff --git a/src/ol/webgl/Helper.js b/src/ol/webgl/Helper.js index af5daa0fe7..504db3342a 100644 --- a/src/ol/webgl/Helper.js +++ b/src/ol/webgl/Helper.js @@ -18,6 +18,7 @@ import { } from '../transform'; import {create, fromTransform} from '../vec/mat4'; import WebGLPostProcessingPass from './PostProcessingPass'; +import {getContext} from '../webgl'; /** @@ -220,7 +221,7 @@ class WebGLHelper extends Disposable { * @private * @type {WebGLRenderingContext} */ - this.gl_ = this.canvas_.getContext('webgl'); + this.gl_ = getContext(this.canvas_); const gl = this.getGL(); /**