# 隐藏默认UI

有些情况,加载模型时并不需要默认的UI,包括工具条、目录树和viewHouse。针对此需求,BIMFACE提供了Glodon.Bimface.Viewer.Viewer3DGlodon.Bimface.Viewer.ViewerDrawingGlodon.Bimface.Viewer.ViewerGIS三类对象。

# 三维模型-Glodon.Bimface.Viewer.Viewer3D

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>My first BIMFACE app</title>
    </head>
<body>
    <div id="domId" style="width:800px; height:600px"></div>
    <script src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js" charset="utf-8"></script>
    <script>
        let viewer3D;
        let viewToken = '<yourViewToken>';
        let loaderConfig = new BimfaceSDKLoaderConfig();
            loaderConfig.viewToken = viewToken;
        BimfaceSDKLoader.load(loaderConfig, successCallback, failureCallback);
            function successCallback(viewMetaData) {
                let domShow = document.getElementById('domId');
                let viewConfig = new Glodon.Bimface.Viewer.Viewer3DConfig();
                    viewConfig.domElement = domShow;    
                viewer3D = new Glodon.Bimface.Viewer.Viewer3D(viewConfig);    
                viewer3D.addView(viewToken);  
            };
            
            function failureCallback(error) {
                console.log(error);
            };
    </script>
</body>
</html>

image

# 二维图纸-Glodon.Bimface.Viewer.ViewerDrawing

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>My first BIMFACE app</title>
    </head>
<body>
    <div id="domId" style="width:800px; height:600px"></div>
    <script src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js" charset="utf-8"></script>
    <script>
        let viewer2D;
        let viewToken = '<yourViewToken>';
        let loaderConfig = new BimfaceSDKLoaderConfig();
            loaderConfig.viewToken = viewToken;
        BimfaceSDKLoader.load(loaderConfig, successCallback, failureCallback);
            function successCallback(viewMetaData) {
                let domShow = document.getElementById('domId');
                let viewConfig = new Glodon.Bimface.Viewer.ViewerDrawingConfig();
                    viewConfig.domElement = domShow;    
                viewer2D = new Glodon.Bimface.Viewer.ViewerDrawing(viewConfig);
                viewer2D.load(viewToken);  
            };
            
            function failureCallback(error) {
                console.log(error);
            };
    </script>
</body>
</html>

image

# GIS场景-Glodon.Bimface.Viewer.ViewerGIS

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>My first BIMFACE app</title>
    </head>
<body>
    <div id="domId" style="width:800px; height:600px"></div>
    <script src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js" charset="utf-8"></script>
    <script>
        let viewerGIS;
        let viewToken = '<yourViewToken>';
        let loaderConfig = new BimfaceSDKLoaderConfig();
        loaderConfig.viewToken = viewToken;
        BimfaceSDKLoader.load(loaderConfig, successCallback, failureCallback);
        function successCallback(viewMetaData) {
            let domShow = document.getElementById('domId');
            let viewConfig = new Glodon.Bimface.Viewer.ViewerGISConfig();
            viewConfig.domElement = domShow;    
            viewerGIS = new Glodon.Bimface.Viewer.ViewerGIS(viewConfig);    
            viewerGIS.addScene(viewToken);  
        };
        
        function failureCallback(error) {
            console.log(error);
        };
    </script>
</body>
</html>

image