From 654073cd3d464d1b468f95409fdcdda9839796cb Mon Sep 17 00:00:00 2001 From: MarquesDeAzevedo <42165864+MarquesDeAzevedo@users.noreply.github.com> Date: Tue, 7 Aug 2018 08:40:42 +0200 Subject: [PATCH] WMTS getCapabilities readCoodinates more than one whitespace delimiter Some WMTS getCapabilities return with more than one whitespace as delimiter between the coordinates. This leads to the layer not being displayed, because the origin_ property of ol.tilegrid.TileGrid is not set. Error in ol.tilegrid.TileGrid.prototype.getTileCoordForXYAndZ_: JavaScript runtime error: Unable to get property '0' of undefined or null reference --- src/ol/format/WMTSCapabilities.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/format/WMTSCapabilities.js b/src/ol/format/WMTSCapabilities.js index 30967421b5..f0c6ed5373 100644 --- a/src/ol/format/WMTSCapabilities.js +++ b/src/ol/format/WMTSCapabilities.js @@ -340,7 +340,7 @@ function readLegendUrl(node, objectStack) { * @return {Object|undefined} Coordinates object. */ function readCoordinates(node, objectStack) { - const coordinates = readString(node).split(' '); + const coordinates = readString(node).replace(/\s\s+/g, ' ').split(' '); if (!coordinates || coordinates.length != 2) { return undefined; }