CorridorOutlineGeometry是用于绘制走廊边框的几何体,其由一系列贴着路径排列的矩形轮廓线条组成。
以下是CorridorOutlineGeometry对象的语法:
new Cesium.CorridorOutlineGeometry(options)
参数:
下面的代码创建了一条路径并使用CorridorOutlineGeometry绘制了该路径的边框:
var viewer = new Cesium.Viewer('cesiumContainer');
var corridorPositions = [
Cesium.Cartesian3.fromDegrees(-75.10, 39.57),
Cesium.Cartesian3.fromDegrees(-77.02, 38.88),
Cesium.Cartesian3.fromDegrees(-80.19, 25.76),
Cesium.Cartesian3.fromDegrees(-77.03, 18.47)
];
var corridorOutlineGeometry = new Cesium.CorridorOutlineGeometry({
positions: corridorPositions,
width: 200000,
granularity: Cesium.Math.RADIANS_PER_DEGREE / 20
});
var corridorOutlineInstance = new Cesium.GeometryInstance({
geometry: corridorOutlineGeometry,
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW)
}
});
viewer.scene.primitives.add(new Cesium.Primitive({
geometryInstances: [corridorOutlineInstance],
appearance: new Cesium.PerInstanceColorAppearance({
flat: true,
translucent: false
})
}));
以下是CorridorOutlineGeometry对象支持的方法:
使用提供的几何图形参数创建几何体对象。
参数:
返回值:
以下是CorridorOutlineGeometry对象支持的属性:
用于打包的常量。