首页 / 浏览问题 / 三维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日
发布完成之后url预览时可以的。
那看看代码写的有没有问题。

还有是访问代码里写的url哈,看看能不能正常访问。
代码是直接用的你们示例代码,我把路径改了下,这个路径是发布成功后的那个服务地址的话,就没有错
那你贴下你的代码,看看是不是url写错了,比如少写了一级
<!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 : 'http://localhost:8090/iserver/services/3D-test-s3m/rest',
                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>
imageryprovider中写的url不对。建议参考下js/config.js,看看里面的影像服务的地址是怎么写的哈。
这个路径不是我们发布之后的那个服务地址吗?
还有就是单独访问这个路径会出来这个地图数据吗?

那个我在打扰下,就是我把路径换成了http://localhost:8090/iserver/services/3D-test-s3m/rest/realspace/datas/Config/config这个,但是还是加载数据模型报错。

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

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)

这个imageryprovider是用来加载影像或者地图服务的,不是用来加载三维切片缓存的,三位切片缓存的加载方式请用该示例中下部的scene.addS3MTilesLayerByScp方法
那我想请教下,这个路径。怎么写才对呢
而且,我把路径换成了您说的config.js里面的,发现也是这种报错
首先你要确定你调用的接口没有问题。比如说,BingMapsImageryProvider对应的是bingmap的在线地图服务,调用发布在iServer上的服务的话需要用到SuperMapImageryProvider;还有加载三维切片缓存服务需要用到scene.addS3MTilesLayerByScp。
我这边直接打开那个url出来这些:

1.10000 OSGBCacheFile GLOBAL 13.036514752103475 47.812411533154567 -380.00000 13.03458068962882 47.819793672731379 13.038448814578132 47.805029393577755 .\Tile_-8705_2373\Tile_-8705_2373.s3m-43.380624 334.008362 437.981060 498.209743 .\Tile_-8704_2373\Tile_-8704_2373.s3m -1.912395 -288.541609 437.992608 146.886145 .\Tile_-8703_2373\Tile_-8703_2373.s3m 41.887913 -618.422716 437.967061227.877858 100.water

是不是就是正确的路径
是得没错。然后这是三维切片缓存的配置文件。
那就证明这个路径没错的话,还是会报上面的错误
把你现在的代码发一下
<!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对吗?
现在还是无法加载影像或者报错吗?
...