首页 / 浏览问题 / 三维 / 问题详情
在SCENE3D中添加entities后,切换为SCENE2D时报错
8月31日, 2021

使用产品:iclient3D WebGL
问题详细描述:在SCENE3D中添加面状或线状entities后,场景切换为COLUMBUS_VIEW或SCENE2D时报错。
问题重现步骤:1、在http://support.supermap.com.cn:8090/webgl/examples/webgl/editor.html#bingMap 基础上更改代码如下:

function onload(Cesium) {
        //使用BingMap影像服务初始化viewer部件
        var viewer = new Cesium.Viewer('cesiumContainer',{navigation: false,
            sceneModePicker: true});
        viewer.imageryLayers.addImageryProvider(new Cesium.BingMapsImageryProvider({
            key : URL_CONFIG.BING_MAP_KEY,//可至官网(https://www.bingmapsportal.com/)申请key
            url : URL_CONFIG.BINGMAP
        }));
        $('#loadingbar').remove();
        addPolygon(viewer);
        addPolyline(viewer);
    }
    function addPolygon(viewer){
        var entity1 = viewer.entities.add({
			name: "polylgon",
			polygon: {
			    hierarchy: Cesium.Cartesian3.fromDegreesArray([
			    	107.959096,
			    	33.219525,
			    	108.9597922,
			    	33.21952,
			    	108.959757,
			    	34.2190098,
			    	107.959091,
			    	34.219045
			    ]),
//			    extrudedHeight: 0,//面拉伸高度
			    material: Cesium.Color.YELLOW.withAlpha(0.3),
			    outline: true,
			    outlineColor: Cesium.Color.YELLOW,
			    arcType: Cesium.ArcType.RHUMB,
			    clampToGround: true
			  }
		});
		viewer.zoomTo(entity1);
    }
    function addPolyline(viewer){
        var entity2 = viewer.entities.add({
			name: "polyline",
			polyline: {
			    positions: Cesium.Cartesian3.fromDegreesArray([107.958521,34.219594,108.959729,34.219627,107.958521,33.219594]),
			    width: 5,
			    clampToGround: true,
			    material: new Cesium.PolylineOutlineMaterialProperty({
		              color: Cesium.Color.ORANGE,
		              outlineWidth: 2,
		              outlineColor: Cesium.Color.BLACK,
	            }),
			}
		});
		viewer.zoomTo(entity2);
    }
    if (typeof Cesium !== 'undefined') {
        window.startupCalled = true;
        onload(Cesium);
    }

2、从三维视图切换到二维视图或哥伦布视图时,只调用addPolyline时提示异常如下:

只调用addPolygon时错误类似,cannot set property 'owner' of undefined

1个回答

您好,我这边验证了一下的确是有这个问题,感谢您的反馈,这边已经上报缺陷。解决之后我再联系您
卷饼先生  (6,042分)  登峰造极
8月31日, 2021
您好,这边问题已经解决,您这边留个邮箱,我发个新包给您
...