WMTS getCapabilities readCoodinates more than one whitespace delimiter

Some WMTS getCapabilities return <MatrixSet><TopLeftCorner> 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
This commit is contained in:
MarquesDeAzevedo
2018-08-07 08:40:42 +02:00
committed by GitHub
parent a354e842ab
commit 654073cd3d

View File

@@ -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;
}