首页 / 浏览问题 / 三维GIS / 问题详情
倾斜摄影数据展示问题
20EXP 2018年03月28日
我这边在加载模型的时候碰到一下错误,求解决啊!!!!

渲染时发生错误,已停止渲染。

DeveloperError: scp url or name is required! Error at new t (eval at <anonymous> (http://localhost:8090/ceshi/Build/Cesium/Cesium.js:25:1), <anonymous>:1:3281) at ze.(anonymous function).(anonymous function) [as addS3MTilesLayerByScp] (eval at <anonymous> (http://localhost:8090/ceshi/Build/Cesium/Cesium.js:25:1), <anonymous>:1:2920917) at onload (http://localhost:8090/ceshi/ceshi.html:60:33) at Object.execCb (http://localhost:8090/ceshi/js/require.min.js:29:260) at X.check (http://localhost:8090/ceshi/js/require.min.js:18:423) at X.<anonymous> (http://localhost:8090/ceshi/js/require.min.js:23:9) at http://localhost:8090/ceshi/js/require.min.js:8:70 at http://localhost:8090/ceshi/js/require.min.js:23:369 at y (http://localhost:8090/ceshi/js/require.min.js:7:172) at X.emit (http://localhost:8090/ceshi/js/require.min.js:23:340)

1个回答

scp url or name is required!

这个一般说明url没有访问到,建议将url直接用浏览器打开看看会不会报错。

或者有可能调用此方法时根本没有写入url。
5,560EXP 2018年03月29日
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>倾斜模型</title>
    <link href="Build/Cesium/Widgets/widgets.css" rel="stylesheet">
    <link href="css/pretty.css" rel="stylesheet">
    <script src="js/jquery.min.js"></script>
    <script src="js/config.js"></script>
    <script type="text/javascript" src="js/require.min.js" data-main="js/main"></script>
    <!--<script src="Build/Cesium/Workers/zlib.min.js" type="text/javascript" charset="utf-8"></script>-->
    <style>
        html, body, #cesiumContainer {
            width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;background-color: #000000;
        }
    </style>
</head>
<body>
<div id="cesiumContainer"></div>
<div id='loadingbar' class="spinner">
    <div class="spinner-container container1">
        <div class="circle1"></div>
        <div class="circle2"></div>
        <div class="circle3"></div>
        <div class="circle4"></div>
    </div>
    <div class="spinner-container container2">
        <div class="circle1"></div>
        <div class="circle2"></div>
        <div class="circle3"></div>
        <div class="circle4"></div>
    </div>
    <div class="spinner-container container3">
        <div class="circle1"></div>
        <div class="circle2"></div>
        <div class="circle3"></div>
        <div class="circle4"></div>
    </div>
</div>
<span><img src="./images/hlj.png" style="left: 30px; bottom: 80px;position: absolute;display: block;width: 123px;"></span>
<script type="text/javascript">
    var viewer;
    var host = document.location.toString().match(/file:\/\//)?"http://localhost:8090":'http://' + document.location.host;
    function onload(Cesium) {
        //初始化viewer部件
        viewer = new Cesium.Viewer('cesiumContainer',{
            imageryProvider: new Cesium.BingMapsImageryProvider({
                url : 'https://www.supermapol.com/realspace/services/3D-HuanJingJianCe/rest/realspace/datas/rs0300@%E6%88%BF%E5%B1%B1',
                mapStyle : Cesium.BingMapsStyle.AERIAL
            })
        });

        var scene = viewer.scene;
        var widget = viewer.cesiumWidget;
        $('#loadingbar').remove();
        try{
            //场景添加S3M图层服务
            var promise = scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_SUOFEIYA,{
                name : 'suofeiya'
            });
            Cesium.when(promise,function(layer){
                //设置相机位置,定位至模型
                scene.camera.setView({
                    //将经度、纬度、高度的坐标转换为笛卡尔坐标
                    destination : new Cesium.Cartesian3(-2653978.5835163584,3570943.4283337835,4570245.122806637),
                    orientation : {
                        heading : 2.48747241877755,
                        pitch : 0.03043141939608285,
                        roll : 6.283185307179394
                    }
                });
            },function(e){
                if (widget._showRenderLoopErrors) {
                    var title = '渲染时发生错误,已停止渲染。';
                    widget.showErrorPanel(title, undefined, e);
                }
            });
        }
        catch(e){
            if (widget._showRenderLoopErrors) {
                var title = '渲染时发生错误,已停止渲染。';
                widget.showErrorPanel(title, undefined, e);
            }
        }
    }
    </script>
</body>
</html>
和刚刚一样,就是路径换了

首先你要确定你调用的接口没有问题。比如说,BingMapsImageryProvider对应的是bingmap的在线地图服务,调用发布在iServer上的服务的话需要用到SuperMapImageryProvider;还有加载三维切片缓存服务需要用到scene.addS3MTilesLayerByScp。

发表于 2 小时前 | 用户: 张阳名 名扬四海

-----------------------------------------------------------

你这个不是bingmap的在线地图服务吧。

如果还是不太理解的话,可以参考下其他示例,比如“地形影像”

http://support.supermap.com.cn:8090/webgl/examples/editor.html#terrainAndImagery

这里面有如何加载iServer影像服务的方法。

嗯,也就是说我这边服务使用错了,我这边把BingMapsImageryProvider换成SuperMapImageryProvider对吗?
现在还是无法加载影像或者报错吗?
...