diff --git a/doc/errors/index.md b/doc/errors/index.md index d783685479..687d9efbf1 100644 --- a/doc/errors/index.md +++ b/doc/errors/index.md @@ -220,3 +220,11 @@ Duplicate item added to a unique collection. For example, it may be that you tr ### 59 Invalid command found in the PBF. This indicates that the loaded vector tile may be corrupt. + +### 60 + +Missing or invalid `size`. + +### 61 + +Cannot determine IIIF Image API version from provided image information JSON. diff --git a/src/ol/format/IIIFInfo.js b/src/ol/format/IIIFInfo.js index d88db27d22..f6ec81d261 100644 --- a/src/ol/format/IIIFInfo.js +++ b/src/ol/format/IIIFInfo.js @@ -89,10 +89,8 @@ function getComplianceLevelOfImageInfoForVersion(imageInfo, version) { && typeof imageInfo.profile[0] === 'string') { return imageInfo.profile[0]; } - // TODO error: cannot get compliance level URL / string - break; + return; default: - // TODO error: invalid Image API version } } @@ -111,11 +109,10 @@ function getVersionOfImageInfo(imageInfo) { if (getComplianceLevelOfImageInfoForVersion(imageInfo, Versions.VERSION1)) { return Versions.VERSION1; } - // TODO error: can't detect Image API version break; default: - // TODO error: can't detect Image API version } + assert(false, 61); } function getLevelProfileForImageInfo(imageInfo) { diff --git a/src/ol/source/IIIF.js b/src/ol/source/IIIF.js index ec49e7a9b7..05babdd608 100644 --- a/src/ol/source/IIIF.js +++ b/src/ol/source/IIIF.js @@ -54,9 +54,8 @@ class IIIF extends TileImage { const version = options.version || Versions.VERSION2; const sizes = options.sizes || []; const size = options.size; - // TODO Appropriate error code assert(size != undefined && Array.isArray(size) && size.length == 2 && - !isNaN(size[0]) && size[0] > 0 && !isNaN(size[1] && size[1] > 0), 999); + !isNaN(size[0]) && size[0] > 0 && !isNaN(size[1] && size[1] > 0), 60); const width = size[0]; const height = size[1]; const tileSize = options.tileSize;