CircleVectorPrimitive

Draws the points of a BufferPointCollection as screen-space circles with a fill and an outline.

Each visual property is either one value for every point, or a callback returning the value for a given point. The point passed to a callback is reused between calls and must not be retained. Callbacks are evaluated when a point is added or changed, or when a property is assigned, and the results are cached; call VectorPrimitive#makeStyleDirty after changing data that a callback reads. While any property is a callback, the other values are cached too, so in-place changes such as primitive.color.alpha = 0.5 also require VectorPrimitive#makeStyleDirty.

new Cesium.CircleVectorPrimitive(options)

Name Type Description
options CircleVectorPrimitiveOptions
Examples:
const collection = new Cesium.BufferPointCollection();
collection.add({ position: Cesium.Cartesian3.fromDegrees(-75.16, 39.95) });

viewer.scene.primitives.add(
  new Cesium.CircleVectorPrimitive({
    collection,
    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,
  }),
);
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:
Fill color of each circle.
Default Value: Color.WHITE
Whether each point is drawn. When undefined, every point is drawn. Points hidden with BufferPrimitive#show are never drawn.
Outline color of each circle.
Default Value: Color.BLACK

outlineWidth : number|function

Outline width of each circle, in pixels.
Default Value: 0.0
Radius of each circle, in pixels.
Default Value: 5.0
Whether the vector primitive is drawn.
Inherited From:
Default Value: true

Methods

Destroys the GPU resources of the vector primitive. The collection is not destroyed.
Inherited From:

isDestroyed() → boolean

Returns true if this object was destroyed; otherwise, false.
Returns:
True if this object was destroyed; otherwise, false.
Inherited From:
Marks the visual properties as dirty, so per-primitive callbacks are evaluated again on the next frame. Callbacks are otherwise evaluated only when a primitive changes or a property is assigned, so call this after changing data that a callback reads.
Inherited From:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.