From 23858dc09d381c8121ca08751712748d8b710334 Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Sun, 19 Jan 2020 11:28:05 +0000 Subject: [PATCH] Convert any html character codes in labels --- src/ol/format/KML.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ol/format/KML.js b/src/ol/format/KML.js index 0c2a2b2186..2773f53392 100644 --- a/src/ol/format/KML.js +++ b/src/ol/format/KML.js @@ -946,6 +946,12 @@ function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles, if (drawName) { name = /** @type {string} */ (feature.get('name')); drawName = drawName && !!name; + // convert any html character codes + if (drawName && name.search(/&[^&]+;/) > -1) { + const text = document.createElement('textarea'); + text.innerHTML = name; + name = text.value; + } } if (style) {