您好,
HeightReference接口下的三种方法分别为:
CLAMP_TO_GROUND 贴地面
NONE 绝对高度
RELATIVE_TO_GROUND 相对地面的高度
如果要贴对象,可以使用 clampToS3M: true,该参数为entity对象的参数,使用方法如下
var polygon = viewer.entities.add({
polygon: {
hierarchy: {
positions: [new Cesium.Cartesian3.fromDegrees(103.808874884716, 30.6618438948975, 0.449),new Cesium.Cartesian3.fromDegrees(103.809516962045, 30.6622166526969, 0.447),new Cesium.Cartesian3.fromDegrees(103.809787219443, 30.6618685901869, 3.447),new Cesium.Cartesian3.fromDegrees(103.809150007665, 30.6615278368998, 0.207)]},
material: Cesium.Color.BLUE.withAlpha(0.5),
clampTos3m: true
}
})