浏览代码

Wait for first update to load root tile set

Garrett Johnson 5 年之前
父节点
当前提交
2c16d20431
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 10 3
      src/base/TilesRendererBase.js

+ 10 - 3
src/base/TilesRendererBase.js

@@ -54,8 +54,6 @@ export class TilesRendererBase {
 		this.loadSiblings = true;
 		this.maxDepth = Infinity;
 
-		this.loadTileSet( url );
-
 	}
 
 	traverse( cb ) {
@@ -75,7 +73,16 @@ export class TilesRendererBase {
 		const lruCache = this.lruCache;
 		const tileSets = this.tileSets;
 		const rootTileSet = tileSets[ this.rootSet ];
-		if ( ! rootTileSet || ! rootTileSet.root ) return;
+		if ( ! ( this.rootSet in tileSets ) ) {
+
+			this.loadTileSet( this.rootSet );
+			return;
+
+		} else if ( ! rootTileSet || ! rootTileSet.root ) {
+
+			return;
+
+		}
 
 		const root = rootTileSet.root;