Interface MeasureRulerOptions

interface MeasureRulerOptions {
    arrowLineHeight?: number;
    arrowLineLength?: number;
    arrowStyle?: {
        color?: ColorRepresentation;
        opacity?: number;
    };
    autoFromWorld?: boolean;
    distRatio?: number;
    endPoint: [number, number, number] | Vector3;
    fractionDigits?: number;
    planePoint?: [number, number, number] | Vector3;
    rulerLineStyle?: LineMaterialParameters;
    showTextCb?: ((ptStart, ptEnd, dist, fractionDigits) => string);
    sideLineLength?: number;
    sideLineStyle?: LineMaterialParameters;
    startPoint: [number, number, number] | Vector3;
    textAngleCb?: ((ptStart, ptEnd, quat) => [{
        angle: number;
        axis: Vector3 | "x" | "y" | "z";
    }]);
    textStyle?: LabelOptions;
}

Properties

arrowLineHeight?: number

箭头高度, 为零不显示

arrowLineLength?: number

箭头长度, 为零不显示

arrowStyle?: {
    color?: ColorRepresentation;
    opacity?: number;
}

箭头样式

Type declaration

  • Optional color?: ColorRepresentation

    颜色

  • Optional opacity?: number

    透明度(0-1)

autoFromWorld?: boolean

自动转换为地图坐标 默认true

distRatio?: number

自动求坐标的相对于线长度的比例 默认 1/ 15

endPoint: [number, number, number] | Vector3

标尺结束点

fractionDigits?: number

小数点位数,默认2

planePoint?: [number, number, number] | Vector3

标尺所在平面的另外一点,默认原心(0,0,0)

rulerLineStyle?: LineMaterialParameters

标尺线样式

showTextCb?: ((ptStart, ptEnd, dist, fractionDigits) => string)

显示文字回调

Type declaration

    • (ptStart, ptEnd, dist, fractionDigits): string
    • 显示文字回调

      Parameters

      • ptStart: Vector3
      • ptEnd: Vector3
      • dist: number
      • fractionDigits: number

      Returns string

sideLineLength?: number

两侧线长度, 为零不显示

sideLineStyle?: LineMaterialParameters

两侧线样式

startPoint: [number, number, number] | Vector3

标尺起始点

textAngleCb?: ((ptStart, ptEnd, quat) => [{
    angle: number;
    axis: Vector3 | "x" | "y" | "z";
}])

设置文字旋转回调

Type declaration

    • (ptStart, ptEnd, quat): [{
          angle: number;
          axis: Vector3 | "x" | "y" | "z";
      }]
    • 设置文字旋转回调

      Parameters

      • ptStart: Vector3
      • ptEnd: Vector3
      • quat: Quaternion

      Returns [{
          angle: number;
          axis: Vector3 | "x" | "y" | "z";
      }]

textStyle?: LabelOptions

文本