Scene中的地形或三维瓷砖上的多段线。
Only to be used with GeometryInstances containing GroundPolylineGeometry.
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | optional
具有以下属性的对象:
|
Example:
// 1. Draw a polyline on terrain with a basic color material
var instance = new Cesium.GeometryInstance({
geometry : new Cesium.GroundPolylineGeometry({
positions : Cesium.Cartesian3.fromDegreesArray([
-112.1340164450331, 36.05494287836128,
-112.08821010582645, 36.097804071380715
]),
width : 4.0
}),
id : 'object returned when this instance is picked and to get/set per-instance attributes'
});
scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
geometryInstances : instance,
appearance : new Cesium.PolylineMaterialAppearance()
}));
// 2. Draw a looped polyline on terrain with per-instance color and a distance display condition.
// Distance display conditions for polylines on terrain are based on an approximate terrain height
// instead of true terrain height.
var instance = new Cesium.GeometryInstance({
geometry : new Cesium.GroundPolylineGeometry({
positions : Cesium.Cartesian3.fromDegreesArray([
-112.1340164450331, 36.05494287836128,
-112.08821010582645, 36.097804071380715,
-112.13296079730024, 36.168769146801104
]),
loop : true,
width : 4.0
}),
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)),
distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000)
},
id : 'object returned when this instance is picked and to get/set per-instance attributes'
});
scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
geometryInstances : instance,
appearance : new Cesium.PolylineColorAppearance()
}));
Members
-
Default Value:
true
appearance : Appearance
Appearance是用来给这个原始人着色的。每个几何体
实例以相同的外观着色。一些表象,比如
PolylineColorAppearance允许给每个实例唯一
属性。-
Default Value:
undefined
-
Default Value:
true
classificationType : ClassificationType
-
Default Value:
ClassificationType.BOTH
Draws the bounding sphere for each draw command in the primitive.
-
Default Value:
false
If true, draws the shadow volume for each geometry in the primitive.
-
Default Value:
false
readonly geometryInstances : Array|GeometryInstance
options.releaseGeometryInstances,则为undefined
构造原语时为true。
Changing this property after the primitive is rendered has no effect.
-
Default Value:
undefined
-
Default Value:
false
GroundPolylinePrimitive#update
被称为。readonly readyPromise : Promise.<GroundPolylinePrimitive>
true时,原语不保留对输入geometryInstances的引用以节省内存。-
Default Value:
true
-
Default Value:
true
Methods
Returns:
| Name | Type | Description |
|---|---|---|
scene |
Scene | 当前场景。 |
Returns:
Once an object is destroyed, it should not be used; calling any function other than
isDestroyed will result in a DeveloperError exception. Therefore,
assign the return value (undefined) to the object as done in the example.
Throws:
-
DeveloperError :此对象已销毁,即调用destroy()。
Example:
e = e && e.destroy();
See:
GeometryInstance的每个实例的可修改属性。| Name | Type | Description |
|---|---|---|
id |
* | GeometryInstance的id。 |
Returns:
Throws:
-
DeveloperError :必须在调用getGeometryInstanceAttributes之前调用update。
Example:
var attributes = primitive.getGeometryInstanceAttributes('an id');
attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
If this object was destroyed, it should not be used; calling any function other than
isDestroyed will result in a DeveloperError exception.
Returns:
true;否则为false。Viewer或CesiumWidget将场景渲染到
获取渲染此基本体所需的draw命令。
Do not call this function directly. This is documented just to list the exceptions that may be propagated when the scene is rendered:
Throws:
-
DeveloperError :对于同步GroundPolylinePrimitives,必须调用GRUndPolylinePrimitives.initializeTerrainHeights()并等待返回的承诺解决。
-
DeveloperError :所有geometryInstance必须具有颜色属性才能将PolylineColorAppearance与GroundPolylinePrimitive一起使用。
