首页 / 浏览问题 / 三维GIS / 问题详情
Cesium中多边形entity无法贴s3m格式的倾斜摄影?
256EXP 2021年03月26日

在倾斜摄影的demo中加载多边形实体,设置贴地不起效果

            var cyanPolygon = viewer.entities.add({
                  name: "Cyan vertical polygon with per-position heights and outline",
                  polygon: {
                    hierarchy: Cesium.Cartesian3.fromDegreesArray([
                      126.619,
                      45.769,
                      126.619,
                      45.77,
                      126.621,
                      45.77,
                     126.621,
                      45.769
                    ]),
                    material: Cesium.Color.CYAN.withAlpha(0.5),
                    outline: true,
                    outlineColor: Cesium.Color.BLACK,
                    clampToS3M:true
  },
});

1个回答

您好,您把clampToS3M写在entity里而不是polygon属性里:

var cyanPolygon = viewer.entities.add({
	name: "Cyan vertical polygon with per-position heights and outline",
	polygon: {
		hierarchy: Cesium.Cartesian3.fromDegreesArray([
			126.619,
			45.769,
			126.619,
			45.77,
			126.621,
			45.77,
			126.621,
			45.769
		]),
		material: Cesium.Color.CYAN.withAlpha(0.5),
		outline: true,
		outlineColor: Cesium.Color.BLACK,

	},
	clampToS3M: true
});

jjz
4,720EXP 2021年03月29日

那你们的接口文档有错误。

确实容易使人误解,我报个缺陷吧。

您是不是之前提过自定义专题图颜色太难设置?那个您现在可以直接用16进制RGB设置了,在属性表那边有个以16进制显示的选项,您可以直接改。我测试过了,10.1.1版本的桌面颜色是正确的。
...