您好,您把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
});