A description of a polyline modeled as a line strip; the first two positions define a line segment,
and each additional position defines a line segment from the previous position. The polyline is capable of
displaying with a material.
alias PolylineGeometry
- The options object takes the following properties
- {Cartesian3[]} options.positions An array of Cartesian3 defining the positions in the polyline as a line strip.
- {Number} [options.width=1.0] The width in pixels.
- {Color[]} [options.colors] An Array of Color defining the per vertex or per segment colors.
- {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.
- {Boolean} [options.followSurface=true] A boolean that determines whether positions will be adjusted to the surface of the ellipsoid via a great arc.
- {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.followSurface=true. Determines the number of positions in the buffer.
- {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
- {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
exception {DeveloperError} At least two positions are required.
exception {DeveloperError} width must be greater than or equal to one.
exception {DeveloperError} colors has an invalid length.
// A polyline with two connected line segments
var polyline = new Cesium.PolylineGeometry({
positions : Cesium.Cartesian3.fromDegreesArray([
0.0, 0.0,
5.0, 0.0,
5.0, 5.0
]),
width : 10.0
});
var geometry = Cesium.PolylineGeometry.createGeometry(polyline);
A description of a polyline modeled as a line strip; the first two positions define a line segment, and each additional position defines a line segment from the previous position. The polyline is capable of displaying with a material.
alias PolylineGeometry
- The options object takes the following properties - {Cartesian3[]} options.positions An array of Cartesian3 defining the positions in the polyline as a line strip. - {Number} [options.width=1.0] The width in pixels. - {Color[]} [options.colors] An Array of Color defining the per vertex or per segment colors. - {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices. - {Boolean} [options.followSurface=true] A boolean that determines whether positions will be adjusted to the surface of the ellipsoid via a great arc. - {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.followSurface=true. Determines the number of positions in the buffer. - {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
exception {DeveloperError} At least two positions are required. exception {DeveloperError} width must be greater than or equal to one. exception {DeveloperError} colors has an invalid length.
// A polyline with two connected line segments var polyline = new Cesium.PolylineGeometry({ positions : Cesium.Cartesian3.fromDegreesArray([ 0.0, 0.0, 5.0, 0.0, 5.0, 5.0 ]), width : 10.0 }); var geometry = Cesium.PolylineGeometry.createGeometry(polyline);
PolylineGeometry#createGeometry demo Sandcastle Polyline Demo