DrawHandler

new SuperMap3D.DrawHandler(viewer, mode, clampMode)

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

Members

readonlyactiveEvt : Event

Draw handler's activation event.
Example:
handler.activeEvt.addEventListener(function(result){
});

clampMode : Number

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

readonlydrawEvt : Event

Draw completion event, listen to the draw completion 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, which is enabled by default

readonlymovingEvt : Event

Draw handler's move event.
Example:
handler.movingEvt.addEventListener(function(result){
});

Methods

activate()

active handler。

clear()

Clear all primitives.

deactivate()

Invalidate the handler.