From 1c9380adb4257abca49b5fbde1797c94b8352da6 Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Fri, 6 Dec 2019 19:35:48 +0100 Subject: [PATCH] Fix ol layer switching --- js/src/mapapi/api_openlayers.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/mapapi/api_openlayers.js b/js/src/mapapi/api_openlayers.js index 904e44d..2325e26 100644 --- a/js/src/mapapi/api_openlayers.js +++ b/js/src/mapapi/api_openlayers.js @@ -362,7 +362,11 @@ export default class OpenLayersApi { } layerRadio.name = 'layer'; layerRadio.value = _layer.get('name'); - layerRadio.onclick = (e) => this.switchLayer(e.value); + layerRadio.onclick = (e) => { + /** @type {HTMLInputElement} */ + const el = e.target; + this.switchLayer(el.value); + }; if (_layer.getVisible()) { layerRadio.checked = true; }