null pointer fix and improved handling of Identifier
Fix nullpointer error when a matrixSet is not found in the matrixsetobj when matrix limits exist. Also check for match by prepending matrixSetObj.Identifier which is supported by some wmts services.
This commit is contained in:
@@ -465,10 +465,12 @@ export function optionsFromCapabilities(wmtsCap, config) {
|
|||||||
//in case of matrix limits, use matrix limits to calculate extent
|
//in case of matrix limits, use matrix limits to calculate extent
|
||||||
if (matrixLimits) {
|
if (matrixLimits) {
|
||||||
selectedMatrixLimit = matrixLimits[matrixLimits.length - 1];
|
selectedMatrixLimit = matrixLimits[matrixLimits.length - 1];
|
||||||
matrix = find(
|
const m = find(
|
||||||
matrixSetObj.TileMatrix,
|
matrixSetObj.TileMatrix,
|
||||||
(value) => value.Identifier === selectedMatrixLimit.TileMatrix
|
(tileMatrixValue) => tileMatrixValue.Identifier === selectedMatrixLimit.TileMatrix || matrixSetObj.Identifier + ":" + tileMatrixValue.Identifier === selectedMatrixLimit.TileMatrix
|
||||||
);
|
);
|
||||||
|
if (m)
|
||||||
|
matrix = m;
|
||||||
}
|
}
|
||||||
|
|
||||||
const resolution =
|
const resolution =
|
||||||
|
|||||||
Reference in New Issue
Block a user