MeasurementLengthStraight

직선 거리 계산 및 영역 표시 클래스.
Straight distance calculation and area display class.

new Ditap.MeasurementLengthStraight(options)

Name Type Description
options object 아래 속성 포함 객체.
Object with the following properties:
Name Type Default Description
viewer DitapViewer 사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.
positions Array.<Cartesian3> optional 직선 거리 측정을 위한 Cartesian 좌표 배열. 지정한 경우 입력 값으로 직선 거리 계산 및 영역 표시되어 수정 불가.
Cartesian coordinate array for measuring straight distances. If specified, the input value is used for calculating the straight distance and displayed in the area, making it unmodifiable.
labelOption String "total" optional 직선 거리 측정 완료 후 라벨 표시 옵션. 지정하지 않은 경우 개별 표시.
"total" : 폴리라인 전체 길이 표시.
"single" : 폴리라인 개별 길이 표시.

Label display option after completing the straight distance measurement. If not specified, display individually.
"total" : Labels displaying the full length of the polyline.
"single" : Labels showing the length for each polyline.
entityColor Color Color.fromBytes(169, 67, 30, 255) optional 엔티티 색상.
Color of the entity.
Example:
// 샌드캐슬 예제 'DiTAP - Straight Length Measurement' 참조

const viewer = new Ditap.DitapViewer("ditapContainer");

// 1. 지정된 영역 생성. (InteractionLengthStraight를 통한 수정 불가.)
const position1 = new Ditap.Cartesian3(
      -3044763.7129576365,
      4043820.120565581,
      3867446.689131772
);
const position2 = new Ditap.Cartesian3(
      -3044777.2576141134,
      4043794.3736621705,
      3867462.8381184633
);
const position3 = new Ditap.Cartesian3(
      -3044790.666652001,
       4043806.9208138464,
       3867439.3203376085
);
const positions = [position1, position2, position3];

const options = {
 viewer: viewer,
 positions: positions,
 labelOption: "total",
 entityColor: Color.fromBytes(169, 67, 30, 255)
};

const measurementLengthStraight = new Ditap.MeasurementLengthStraight(options);

// 2. 마우스로 영역 지정 후 생성. (InteractionLengthStraight를 통해 직선 거리 측정 및 영역 표시.)
const measurementLengthStraight = new Ditap.MeasurementLengthStraight({
 viewer: viewer
});

const interactionLengthStraight = new Ditap.InteractionLengthStraight();
interactionLengthStraight.measurementLengthStraight = measurementLengthStraight;

Members

entityColor

엔티티 색상.
Color of the entity.

isLabelOption : string

직선 길이 측정 완료 후 라벨 표시 옵션.
"total" : 폴리라인 전체 길이 표시.
"single" : 폴리라인 개별 길이 표시.

Label display option after completing the straight distance measurement.
"total" : Labels displaying the full length of the polyline.
"single" : Labels showing the length for each polyline.

※ 주의사항(Note).
측정을 시작하기 전에 옵션 값을 변경하여야 반영. 측정이 완료된 경우 옵션 값 변경 시 반영되지 않음.
Options must be changed before starting the measurement to take effect. Changes to options are not reflected once the measurement is completed.

readonly length : number

측정된 직선 거리 값.
Measured straight length value.

readonly pointEntities : Array.<Entity>

직선 거리 측정으로 얻은 포인트 엔티티 배열.
Array of point entities resulting from straight length measurements.

readonly polylineEntities : Array.<Entity>

직선 거리 측정으로 얻은 폴리라인 엔티티 배열.
Array of polyline entities resulting from straight length measurements.

readonly positions : Array.<Cartesian3>

직선 거리 측정 할 Cartesian 배열
Cartesian array for measuring straight distances.

viewer : DitapViewer

사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.

Methods

destroy()

인스턴스 파괴. 영구적으로 제거하는 경우 호출.
Destroys the instance. Should be called if permanently removing the instance from layout.