Polyline

Polyline

new

A renderable polyline. Create this by calling PolylineCollection#add

Parameters:
Name Type Argument Default Description
options.show Boolean <optional>
true true if this polyline will be shown; otherwise, false.
options.width Number <optional>
1.0 The width of the polyline in pixels.
options.loop Boolean <optional>
false Whether a line segment will be added between the last and first line positions to make this line a loop.
options.material Material <optional>
Material.ColorType The material.
options.positions Array <optional>
The positions.
options.id Object <optional>
The user-defined object to be returned when this polyline is picked.
Demo:
See:
Source:

Methods

Returns the user-defined object returned when the polyline is picked.

Returns:
Object The user-defined object returned when the polyline is picked.

Gets whether a line segment will be added between the first and last polyline positions.

Returns:
Boolean true if the polyline is a loop; otherwise, false.
See:

Gets the surface appearance of the polyline. This can be one of several built-in Material objects or a custom material, scripted with Fabric.

Returns:
Material The material.

Returns the polyline's positions.

Returns:
Array The polyline's positions.
See:

Returns true if this polyline will be shown. Call Polyline#setShow to hide or show a polyline, instead of removing it and re-adding it to the collection.

Returns:
Boolean true if this polyline will be shown; otherwise, false.
See:

Gets the width of the polyline.

Returns:
Number The width of the polyline.
Example
polyline.setWidth(5.0);
var width = polyline.getWidth(); // 5.0
See:

Sets whether a line segment will be added between the first and last polyline positions.

Parameters:
Name Type Description
value Boolean true if the polyline is to be a loop; otherwise, false.
See:

Sets the surface appearance of the polyline. This can be one of several built-in Material objects or a custom material, scripted with Fabric.

Parameters:
Name Type Description
material Material The material
See:

Defines the positions of the polyline.

Parameters:
Name Type Description
value Array The positions of the polyline.
Example
polyline.setPositions(
  ellipsoid.cartographicArrayToCartesianArray([
    new Cesium.Cartographic(...),
    new Cesium.Cartographic(...),
    new Cesium.Cartographic(...)
  ])
);
See:

Determines if this polyline will be shown. Call this to hide or show a polyline, instead of removing it and re-adding it to the collection.

Parameters:
Name Type Description
value Boolean Indicates if this polyline will be shown.
See:

Sets the width of the polyline.

Parameters:
Name Type Description
value Number The width of the polyline.
Example
polyline.setWidth(5.0);
var width = polyline.getWidth(); // 5.0
See: