浏览代码

extend the provided configuration correctly

Raanan Weber 7 年之前
父节点
当前提交
2518a797dc
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Viewer/src/viewer/viewer.ts

+ 3 - 2
Viewer/src/viewer/viewer.ts

@@ -533,7 +533,7 @@ export abstract class AbstractViewer {
             throw new Error("no model url provided");
         }
         if (clearScene) {
-
+            this.sceneManager.clearScene(true, false);
         }
         let configuration: IModelConfiguration;
         if (typeof modelConfig === 'string') {
@@ -546,7 +546,8 @@ export abstract class AbstractViewer {
 
         //merge the configuration for future models:
         if (this._configuration.model && typeof this._configuration.model === 'object') {
-            deepmerge(this._configuration.model, configuration)
+            let globalConfig = deepmerge({}, this._configuration.model)
+            configuration = deepmerge(globalConfig, configuration);
         } else {
             this._configuration.model = configuration;
         }