From ede864c823205426bd150f72cb20cbad3f882c72 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Fri, 31 May 2019 16:18:13 +0200 Subject: [PATCH] Remove typecasts in ol/control/OverviewMap The `options` type was not correctly detected by the typescript compiler. --- src/ol/control/OverviewMap.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ol/control/OverviewMap.js b/src/ol/control/OverviewMap.js index 9d935c0c76..93fceff482 100644 --- a/src/ol/control/OverviewMap.js +++ b/src/ol/control/OverviewMap.js @@ -76,7 +76,7 @@ class OverviewMap extends Control { */ constructor(opt_options) { - const options = opt_options ? opt_options : {}; + const options = opt_options ? opt_options : /** @type {Options} */ ({}); super({ element: document.createElement('div'), @@ -159,13 +159,9 @@ class OverviewMap extends Control { const ovmap = this.ovmap_; if (options.layers) { - /** @type {Array} */ (options.layers).forEach( - /** - * @param {import("../layer/Layer.js").default} layer Layer. - */ - (function(layer) { - ovmap.addLayer(layer); - }).bind(this)); + options.layers.forEach(function(layer) { + ovmap.addLayer(layer); + }); } const box = document.createElement('div');