From df7c89baeb2d31ccd76dbd81478e259e30815458 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Fri, 28 Sep 2018 08:15:59 -0600 Subject: [PATCH] Fix TypeScript errors in ol/format/WMSGetFeatureInfo --- src/ol/format/WMSGetFeatureInfo.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ol/format/WMSGetFeatureInfo.js b/src/ol/format/WMSGetFeatureInfo.js index 13471b03cd..cd3582d7da 100644 --- a/src/ol/format/WMSGetFeatureInfo.js +++ b/src/ol/format/WMSGetFeatureInfo.js @@ -100,10 +100,12 @@ class WMSGetFeatureInfo extends XMLFeature { if (layer.nodeType !== Node.ELEMENT_NODE) { continue; } + + const layerElement = /** @type {Element} */ (layer); const context = objectStack[0]; const toRemove = layerIdentifier; - const layerName = layer.localName.replace(toRemove, ''); + const layerName = layerElement.localName.replace(toRemove, ''); if (this.layers_ && !includes(this.layers_, layerName)) { continue; @@ -115,14 +117,15 @@ class WMSGetFeatureInfo extends XMLFeature { context['featureType'] = featureType; context['featureNS'] = this.featureNS_; + /** @type {Object} */ const parsers = {}; parsers[featureType] = makeArrayPusher( this.gmlFormat_.readFeatureElement, this.gmlFormat_); const parsersNS = makeStructureNS( [context['featureNS'], null], parsers); - layer.setAttribute('namespaceURI', this.featureNS_); + layerElement.setAttribute('namespaceURI', this.featureNS_); const layerFeatures = pushParseAndPop( - [], parsersNS, layer, objectStack, this.gmlFormat_); + [], parsersNS, layerElement, objectStack, this.gmlFormat_); if (layerFeatures) { extend(features, layerFeatures); }