DrawHandler

new Cesium.DrawHandler(viewer, mode, clampMode)

Draw the processor object class. Support the drawing of rasterized area objects.
Name Type Default Description
viewer Viewer viewer object.
mode DrawMode Drawing mode, including point, line, area, icon.
clampMode ClampMode ClampMode.Space optional clampMode drawing style, including space, ground, and object (S3M model).
Example:
var handler = new Cesium.DrawHandler(viewer,Cesium.DrawMode.Line,ClampMode.Ground);
handler.activate();
See:

Members

readonlyactiveEvt : Event

The activation event of the drawing handler.
Example:
handler.activeEvt.addEventListener(function(result){

});

clampMode : Number

Get or set the style of drawing geometric objects, space, ground, and object.

readonlydrawEvt : Event

The drawing complete event, monitor the drawing complete event, and get the current drawing result.

When the drawing mode is DrawMode.Point, the result of the event callback is {object: point}.

When the drawing mode is DrawMode.Polygon, the result of the event callback is {object: polygon}.

When the drawing mode is DrawMode.Line, the result of the event callback is {object: polyline}.

When the drawing mode is DrawMode.Marker, the result of the event callback is {object: marker}.

Example:
handler.drawEvt.addEventListener(function(result){
    console.log(result);
});

enableDepthTest : Boolean

Set whether to enable depth detection for the drawn primitives, enabled by default

readonlymovingEvt : Event

Draw the movement event of the handler.
Example:
handler.movingEvt.addEventListener(function(result){

});

Methods

activate()

Activate the handler.

clear()

Clear all primitives.

deactivate()

Invalidate the handler.