常见问题 > 详情

如何在一个页面显示多个3Dviewer?

image

function onSDKLoadSucceeded(viewMetaData){

    // 初始化第一个viewer
    var view = document.getElementById('view');
    WebAppConfig = new Glodon.Bimface.Application.WebApplication3DConfig();
    WebAppConfig.domElement = view;
    var appEvents = Glodon.Bimface.Application.WebApplication3DEvent;
    var app = new Glodon.Bimface.Application.WebApplication3D(WebAppConfig);
    //第一个模型的viewtoken
    app.addView("fc43da8bd7ee49548fac9336a6450266");     
    app.addEventListener(appEvents.ViewAdded, function() {
        app.render();
    });
    // 初始化第二个viewer
    var view2 = document.getElementById("view1");
    config2 = new Glodon.Bimface.Application.WebApplication3DConfig();
    config2.domElement = view2;
    var app2 = new Glodon.Bimface.Application.WebApplication3D(config2);
    //第二个模型的viewtoken
    app2.addView("fc43da8bd7ee49548fac9336a6450266");
    app2.addEventListener(appEvents.ViewAdded, function() {
        app2.render();
    });
};