Class: DrawLineString

DrawLineString(viewer, optionsopt)

new DrawLineString(viewer, optionsopt)

DrawLineString class for drawing a line string in a Cesium viewer.
Parameters:
Name Type Attributes Description
viewer Cesium.Viewer The Cesium viewer instance.
options Object <optional>
Options for the drawing tool.
Properties
Name Type Attributes Description
color Cesium.Color <optional>
The color of the line string.
clampToGround boolean <optional>
Whether to clamp the line string to the ground.
Source:
Example
const drawLineString = new DrawLineString(viewer, { color: Cesium.Color.RED });
drawLineString.on();
// To disable the drawing tool and clear entities
drawLineString.off();

Methods

off() → {void}

Disables the drawing tool and clears the entities.
Source:
Returns:
Type
void

on() → {boolean|void}

Enables the line string drawing tool. Left click to add points, right click to finish.
Source:
Returns:
  • Continue - Whether to continue measuring after the first click.
    Type
    boolean
  • Type
    void