首页 / 浏览问题 / 三维GIS / 问题详情
plugin 获取sceneControlDiv初始化失败
10EXP 2018年09月26日

<!--StartFragment -->

1个回答

现在是什么现象呢。插件客户端包里的示例代码能否打开呢。
5,560EXP 2018年09月26日
示例代码也打不开,运行不了。

我就是先

<body onload="onPageLoad()">
    <!--场景控件-->
    <div id="sceneControlDiv" style="position:relative; margin: 0; padding: 0; border: 1px solid black; z-index:1;
       left: 0%; width: 100%; top: 0%; height:100%; visibility: visible;">
    </div>

</body>
然后

function onPageLoad() {
    //初始化三维场景控件
    try {
        //初始化三维场景控件实例,参数为包含控件的HTML元素
        sceneControl = new SuperMap.Web.UI.Controls.SceneControl($get("sceneControlDiv"), initCallback, failedCallback);
        openscene();
    }
    catch (e) {
        //若没有安装插件,则抛出该异常
        if (e.name == SuperMap.Web.Realspace.ExceptionName.PlugInNotInstalled) {
            var url = htmlUrl + "/iserver/iClient/for3D/plugin/Setup.exe";
            document.write("<a href='" + url + "'>未检测到 SuperMap iClient3D for  Plugin 插件,请单击此处下载并安装插件。</a>");
            return;
        }
            //若使用非IE浏览器,则抛出该异常
        else if (e.name == SuperMap.Web.Realspace.ExceptionName.BrowserNotSupport) {
            document.write("<p>SuperMap iClient3D for  Plugin 目前仅支持 InternetExplorer 浏览器,请更换浏览器后重新尝试加载本页面。</p>");
            return;
        }
            //抛出其他异常
        else {
            alert(e.message);
        }
    }
}

基本上是照搬的 示例代码,运行报错。
...