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:
@@ -340,7 +340,7 @@ function readLegendUrl(node, objectStack) {
|
|||||||
* @return {Object|undefined} Coordinates object.
|
* @return {Object|undefined} Coordinates object.
|
||||||
*/
|
*/
|
||||||
function readCoordinates(node, objectStack) {
|
function readCoordinates(node, objectStack) {
|
||||||
const coordinates = readString(node).split(' ');
|
const coordinates = readString(node).replace(/\s\s+/g, ' ').split(' ');
|
||||||
if (!coordinates || coordinates.length != 2) {
|
if (!coordinates || coordinates.length != 2) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user