Updates for newer version of the OGC API spec draft

This commit is contained in:
Andreas Hocevar
2021-11-29 10:42:28 +01:00
parent b9b1b535dd
commit 8e6f451553
3 changed files with 266 additions and 174 deletions

View File

@@ -373,11 +373,18 @@ function parseTileSetMetadata(sourceInfo, tileSet) {
);
}
if (!tileSet.tileMatrixSetDefinition) {
throw new Error('Expected tileMatrixSetDefinition or tileMatrixSet');
const tileMatrixSetLink = tileSet.links.find(
(link) =>
link.rel === 'http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme'
);
if (!tileMatrixSetLink) {
throw new Error(
'Expected http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link or tileMatrixSet'
);
}
const tileMatrixSetDefinition = tileMatrixSetLink.href;
const url = resolveUrl(sourceInfo.url, tileSet.tileMatrixSetDefinition);
const url = resolveUrl(sourceInfo.url, tileMatrixSetDefinition);
return getJSON(url).then(function (tileMatrixSet) {
return parseTileMatrixSet(
sourceInfo,