Interface IDrawLineEnterOptions

interface IDrawLineEnterOptions {
    autoFocus?: boolean;
    beforeUpdateCoordinate?: ((point, isMoveing, info, isSnapPoint?) => Promise<Vector3>);
    color?: ColorRepresentation;
    dashOffset?: number;
    dashScale?: number;
    dashSize?: number;
    dashed?: boolean;
    deleteKeyDelPoint?: boolean;
    disableUnProjectMenu?: boolean;
    drawLayerName?: string;
    enterKeyComplete?: boolean;
    escKeyCancel?: boolean;
    gapSize?: number;
    isAddToApp?: boolean;
    isExitToDefaultTool?: boolean;
    isSnap?: boolean;
    lineWidth?: number;
    onComplete?: ((isCancel, data) => void);
    onContextMenu?: ((info, context) => void);
    onKeyUp?: ((info, context) => void);
    opacity?: number;
    pointMaxCount?: number;
    showVertex?: boolean;
    snapData?: [number, number, number][];
    snapDrawPoint?: boolean;
    unprojectOpts?: "depth" | UnProjectOpts;
    updateCoordinate?: ((point, isMoveing, data, polylines?) => void);
}

Properties

autoFocus?: boolean

进入时使div元素自动获取焦点(能响应键盘事件) 默认是

beforeUpdateCoordinate?: ((point, isMoveing, info, isSnapPoint?) => Promise<Vector3>)

坐标更新前回调

Type declaration

    • (point, isMoveing, info, isSnapPoint?): Promise<Vector3>
    • 坐标更新前回调

      Parameters

      • point: Vector3
      • isMoveing: boolean
      • info: TLEventHandler
      • Optional isSnapPoint: boolean

      Returns Promise<Vector3>

color?: ColorRepresentation

颜色

dashOffset?: number

虚线偏移量

dashScale?: number

虚线缩放量

dashSize?: number

虚线尺寸

dashed?: boolean

是否是虚线

deleteKeyDelPoint?: boolean

按delete键删除上一个点 默认是

disableUnProjectMenu?: boolean

右键时是否弹出默认的屏幕空间至世界坐标的投影右键菜单设置 默认 true

drawLayerName?: string

要绘制的绘图图层名称 默认为 draw

enterKeyComplete?: boolean

按回车键完成 默认是

escKeyCancel?: boolean

按esc键取消 默认是

gapSize?: number

间隙尺寸

isAddToApp?: boolean

是否加入应用中,默认false

isExitToDefaultTool?: boolean

退出时直接退出至缺省工具,默认false

isSnap?: boolean

是否捕捉,默认是

lineWidth?: number

线宽

onComplete?: ((isCancel, data) => void)

完成回调

Type declaration

    • (isCancel, data): void
    • 完成回调

      Parameters

      Returns void

onContextMenu?: ((info, context) => void)

右键上下文菜单回调

Type declaration

    • (info, context): void
    • 右键上下文菜单回调

      Parameters

      • info: TLEventHandler
      • context: {
            addPoint: ((worldPos, info?, isSnapPoint?, snapData?) => Promise<void>);
            cancel: (() => void);
            complete: (() => void);
            data: PolylineItemData;
            delPoint: (() => void);
            polylines: PolylinesEntity;
        }
        • addPoint: ((worldPos, info?, isSnapPoint?, snapData?) => Promise<void>)
            • (worldPos, info?, isSnapPoint?, snapData?): Promise<void>
            • Parameters

              Returns Promise<void>

        • cancel: (() => void)

          如需要取消时调用

            • (): void
            • 如需要取消时调用

              Returns void

        • complete: (() => void)

          如需要完成时调用

            • (): void
            • 如需要完成时调用

              Returns void

        • data: PolylineItemData

          当前数据

        • delPoint: (() => void)
            • (): void
            • Returns void

        • polylines: PolylinesEntity

          当前实体

      Returns void

onKeyUp?: ((info, context) => void)

键盘事件

Type declaration

    • (info, context): void
    • 键盘事件

      Parameters

      • info: TLEventHandler
      • context: {
            addPoint: ((worldPos, info?, isSnapPoint?, snapData?) => Promise<void>);
            cancel: (() => void);
            complete: (() => void);
            data: PolylineItemData;
            delPoint: (() => void);
            polylines: PolylinesEntity;
        }
        • addPoint: ((worldPos, info?, isSnapPoint?, snapData?) => Promise<void>)
            • (worldPos, info?, isSnapPoint?, snapData?): Promise<void>
            • Parameters

              Returns Promise<void>

        • cancel: (() => void)

          如需要取消时调用

            • (): void
            • 如需要取消时调用

              Returns void

        • complete: (() => void)

          如需要完成时调用

            • (): void
            • 如需要完成时调用

              Returns void

        • data: PolylineItemData

          当前数据

        • delPoint: (() => void)
            • (): void
            • Returns void

        • polylines: PolylinesEntity

          当前实体

      Returns void

opacity?: number

透明度(0-1)

pointMaxCount?: number

当达到这么多点的个数时自动完成退出

showVertex?: boolean

是否显示顶点

snapData?: [number, number, number][]

自定义要加的捕捉的数据

snapDrawPoint?: boolean

是否捕捉绘制的点,默认是

unprojectOpts?: "depth" | UnProjectOpts

同unproject的第三个参数 (undefined根据地图配置决定, false 不用场景数据, true用场景数据) 深度 (-1近裁剪面 到 1 远裁剪面) 或者输入 平面 或者由一个点所在的屏幕平面 或者使用当前场景实体 或 指定实体数组 或同时指定包含或过滤的实体 depth 使用深度

updateCoordinate?: ((point, isMoveing, data, polylines?) => void)

更新坐标回调

Type declaration

    • (point, isMoveing, data, polylines?): void
    • 更新坐标回调

      Parameters

      Returns void