CircleVectorPrimitive
Cesium v1.147 · 中文

将 BufferPointCollection 中的点绘制为屏幕空间中的圆,具有填充色和轮廓。 每个视觉属性要么为每个点提供一个值,要么是一个回调, 返回给定点的具体值。传递给回调的点在多次调用中会被重复使用,且不应被保留。回调在以下情况下执行: 当添加或更改点时,或者当分配某个属性时,结果会被缓存;修改数据后需调用 VectorPrimitive#makeStyleDirty。 当任何属性是回调时,其他值也会被缓存,因此像 primitive.color.alpha = 0.5 这样的就地更改也需要调用 VectorPrimitive#makeStyleDirty。 const collection = new Cesium.BufferPointCollection(); are cached; call VectorPrimitive#makeStyleDirty after changing data that viewer.scene.primitives.add( new Cesium.CircleVectorPrimitive({ require VectorPrimitive#makeStyleDirty.

new Cesium.CircleVectorPrimitive(options)

Name Type Description
options CircleVectorPrimitiveOptions
Examples:
radius: 8,
color: Cesium.Color.ORANGE,

outlineColor: Cesium.Color.WHITE,
outlineWidth: 2,
const properties = [{ population: 12000 }, { population: 450000 }];
viewer.scene.primitives.add(
new Cesium.CircleVectorPrimitive({
collection,
radius: (point) => Math.sqrt(properties[point.featureId].population) / 50,
  }),
);
color: (point) =>

properties[point.featureId].population > 100000
? Cesium.Color.RED
: Cesium.Color.GRAY,
filter: (point) => properties[point.featureId].population > 1000,
feature is not final and is subject to change without Cesium's standard deprecation policy.
决定圆如何与场景融合。必须为
BlendOption.OPAQUE 或 BlendOption.TRANSLUCENT。
由向量基本体绘制的点。向量基本体并不拥有
该集合;销毁它不会破坏集合本身。
  }),
);
Experimental

This feature is not final and is subject to change without Cesium's standard deprecation policy.

Extends

Members

Determines how the circles are blended with the scene. Must be BlendOption.OPAQUE or BlendOption.TRANSLUCENT.
Default Value: BlendOption.TRANSLUCENT
The points drawn by the vector primitive. The vector primitive does not own the collection; destroying it leaves the collection intact.
Inherited From:
每个圆形的填充颜色。
Default Value: Color.WHITE
是否绘制每个点。若未指定,则绘制所有点。点 通过 BufferPrimitive#show 隐藏的点将不会被绘制。

outlineColor : Color|function

每个圆形的轮廓颜色。
Default Value: Color.BLACK

outlineWidth : number|function

每个圆形的轮廓宽度,以像素为单位。
Default Value: 0.0
每个圆形的半径,以像素为单位。
Default Value: 5.0
是否绘制该向量控件。
Inherited From:
Default Value: true

Methods

销毁向量控件的 GPU 资源。集合本身不会被销毁。 被销毁。
Inherited From:

isDestroyed() → boolean

如果此对象被销毁,则返回 true;否则返回 false。
Returns:
True if this object was destroyed; otherwise, false.
Inherited From:
将视觉属性标记为“脏”,因此会重新评估每个原始元素的回调函数。 在下一帧时再次评估。否则,回调函数仅在原始元素发生变化或属性被设置时评估。因此在回调读取的数据发生变化后调用此函数。 如果原始元素发生变化或属性被赋值,则调用此函数。 返回原始元素的视觉属性值,如果是回调函数则调用它。
Inherited From:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.