Browse Source

Fix support for relative URLs

Garrett Johnson 3 năm trước cách đây
mục cha
commit
185014ab57
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      src/base/TilesRendererBase.js

+ 2 - 1
src/base/TilesRendererBase.js

@@ -339,7 +339,8 @@ export class TilesRendererBase {
 				);
 
 				// remove trailing slash and last path-segment from the URL
-				const basePath = url.replace( /\/[^\/]*\/?$/, '' );
+				let basePath = url.replace( /\/[^\/]*\/?$/, '' );
+				basePath = new URL( basePath, window.location.href ).toString();
 
 				traverseSet(
 					json.root,