Skip to content

Commit

Permalink
Make version checking more precise (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson authored Dec 21, 2023
1 parent 982db66 commit 12a62e9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/base/TilesRendererBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 12a62e9

Please sign in to comment.