用iclient9D写的打开场景,总是打不开

0 投票
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=8" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>三维管线展示</title>
        <script type="text/javascript" src="lib_Ajax/MicrosoftAjax.js"></script>
        <script type="text/javascript" src="lib_Ajax/echarts-all.js"></script>
        <script type="text/javascript" src="lib_Ajax/interface.js"></script>
        <script type="text/javascript" src="lib_Ajax/jquery.js"></script>
        <script type="text/javascript" src="lib_Ajax/SuperMap-7.0.1-11323.js"></script>
        <script type="text/javascript" src="lib_Realspace/SuperMap.Web.Realspace.js"></script>
        <script type="text/javascript" src="Scripts/GettingStarted.js"></script>

        <script type="text/javascript">
            var sceneControl = null;
            var scene = null;
            var htmlUrl = "http://192.168.108.100:8090/iserver/services/3D-Pipe/rest/realspace/scenes";
            //判断网页的打开方式是本地打开还是通过网络打开
            //不同的打开方式url赋值不同
            if(htmlUrl == "")
            {
                htmlUrl = "http://localhost:8090";
            }
            else
            {
               // htmlUrl = "http://" + htmlUrl;
            }

            function onPageLoad()
            {
                //初始化三维场景控件
                try
                {
                    //初始化三维场景控件实例,参数为包含控件的HTML元素
                    sceneControl = new SuperMap.Web.UI.Controls.SceneControl($get("sceneControlDiv"), initCallback, failedCallback);
                }
                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);
                    }
                }
            }

            //控件初始化完成后的回调函数,初始化完成之后才能进行数据加载
            function initCallback()
            {
                //获取Realspace控件的场景,控件和场景是一对一的捆绑关系
                scene = sceneControl.get_scene();

                //新建一个照相机对象,把照相机的位置设置为中国的中心点
                //var camera = new SuperMap.Web.Realspace.Camera(104.348, 28.708, 10288740.0);

                //将场景的视点移动到中国区域
                //scene.get_flyingOperator().flyTo(camera);
                scene.open(htmlUrl,"Pipe3D");
            }

            //控件初始化失败后的回调函数
            function failedCallback()
            {
                alert("Realspace initialized failed!");
            }

        </script>
    </head>

    <body onLoad="onPageLoad()" >
        <div id="sceneControlDiv" style="position:absolute;margin:0;padding:0;border:1px solid black;z-index:1;left:0;width:100%;top:0;height:95%;visibility:visible;">
        </div>
    </body>
</html>
7月 10, 2017 分类:  508次浏览 | 用户: 胡利辉 (3 分)

1个回答

0 投票
 
已采纳
您好,问题已收到。我测试一下 ,之后及时给您反馈。
7月 11, 2017 用户: 郭宇杰 才疏学浅 (11 分)
采纳于 7月 11, 2017 用户:胡利辉
...