From 12a62e91daba0dca870bce3838fa389c5fbf37c8 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Fri, 22 Dec 2023 00:22:12 +0900 Subject: [PATCH] Make version checking more precise (#427) --- src/base/TilesRendererBase.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/base/TilesRendererBase.js b/src/base/TilesRendererBase.js index 29b08aa4e..676bdf35b 100644 --- a/src/base/TilesRendererBase.js +++ b/src/base/TilesRendererBase.js @@ -357,11 +357,18 @@ export class TilesRendererBase { .then( json => { const version = json.asset.version; + const [ major, minor ] = version.split( '.' ).map( v => parseInt( v ) ); console.assert( - version === '1.0' || version === '0.0', - 'asset.version is expected to be a string of "1.0" or "0.0"' + major <= 1, + 'TilesRenderer: asset.version is expected to be a 1.x or a compatible version.', ); + if ( major === 1 && minor > 0 ) { + + console.warn( 'TilesRenderer: tiles versions at 1.1 or higher have limited support. Some new extensions and features may not be supported.' ); + + } + // remove trailing slash and last path-segment from the URL let basePath = url.replace( /\/[^\/]*\/?$/, '' ); basePath = new URL( basePath, window.location.href ).toString();