| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
각각 다음과 같은 속성을 가진 객체. Object with the following properties:
|
Example:
const getUrlFromBase64 = (base64Data) => {
const b64Data = base64Data;
const byteCharacters = window.atob(b64Data);
const byteNumbers = new Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
const blob = new Blob([byteArray], { type: "image/png" });
return URL.createObjectURL(blob);
};
const viewer = new Ditap.DitapViewer("ditapContainer", {
baseLayerPicker: true,
// 지형(터레인 지정)
terrainProviderViewModels: [
new Ditap.ProviderViewModel({
name: "Ditap Korea Terrain",
iconUrl: getUrlFromBase64(
Ditap.ConstantUrl.DITAP_TERRAIN_IMG_URL
),
tooltip: "WGS84 standard ellipsoid, also known as EPSG:4326",
category: "Ditap",
creationFunction: function () {
return Ditap.NationwideTerrainProvider.create();
},
}),
],
});
const destination = Ditap.Cartesian3.fromDegrees(
126.978275264,
37.566642192,
400
);
// 카메라 이동
viewer.scene.camera.flyTo({
destination: destination,
});
//1. 지정된 영역 생성
const positions = [
new Ditap.Cartesian3(-3044739.446567739, 4043823.403143691,3867463.012077135),
new Ditap.Cartesian3(-3044747.714411474, 4043814.3380325786,3867466.015981707),
new Ditap.Cartesian3(-3044752.780860346, 4043817.3342751344,3867458.802892699),
];
const options = {
viewer: viewer,
positions: positions, // 영역 좌표
// entityColor: Color.fromBytes(229, 30, 110, 255) // 엔티티 색상
// planHeight: Ditap.VolumePlanHeightType.AVERAGE, // 계획고 타입
// cellSize: 1, // 분석 해상도
// showCell: false, // 셀 가시화 여부
// fillingVolumeColor: Color.fromBytes(85, 25, 220, 35), // 성토 셀 색상
// cuttingVolumeColor: Color.fromBytes(220, 25, 105, 35), // 절토 셀 색상
// planHeightVolumeColor: Color.GRAY.withAlpha(0.3), // 0 셀 컬러
// callback: () => {}, // 콜백 함수
// classification: VolumeClassificationType.TERRAIN, // 분석 타입
// loading: true, // 로딩 창 여부
};
const measurementVolume = new Ditap.MeasurementVolume(viewer, options);
//2. 체적 재측정
// measurementValume.calculateVolume(options);
//3. 마우스로 영역 지정 후 측정
const measurementVolume = new Ditap.MeasurementVolume({viewer: viewer});
const interactionVolume = new Ditap.InteractionVolume(viewer);
interactionVolume.measurementVolume = measurementVolume;
interactionVolume.on();
Members
계산 종료 후 콜백 함수.
Callback function after volume measurement
cellPrimitive : Array.<Primitive>
측정 영역 셀 Primitive.
Volume area cell primitive.
셀 사이즈.
Volume cell size.
readonly centerPosition : Cartesian3
측정 영역 중심점.
Volume area center position.
높이 추출 유형.
Height value extraction type.
절토량.
Cutting volume.
readonly cuttingVolumeColor : Color
절토량 셀 색상.
Cutting volume cell color.
Cutting volume cell color.
엔티티 색상.
Color of the entity.
Color of the entity.
성토량.
Fill volume.
readonly fillingVolumeColor : Color
성토량 셀 색상.
Fill volume cell color.
Fill volume cell color.
측정 객체 ID.
ID to assign to the measurement object.
계산 완료 여부.
Check that the volume calculation is complete.
계산 중 로딩창.
Loading page during calculation.
계획고.
Volume plan height.
계획고 타입.
Plane hegith type.
pointEntities : Array.<Entity>
측정 영역 포인트 엔티티.
Volume area point entity.
polygonPrimitive : Primitive
측정 영역 polygon primitive.
Volume area polygon primitive.
polylineEntity : Entity
측정 영역 폴리라인 엔티티.
Volume area polyline entity.
readonly positions : Array.<Cartesian3>
측정 영역 좌표.
Measurement area coordinates
셀 가시화.
Visualize volume cell
성토량과 절토량의 합.
Sum of cut and fill volume.
viewer : DitapViewer
사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.
Methods
체적량 계산.
Calculate volume.
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
각각 다음과 같은 속성을 가진 객체. Object with the following properties:
|
Returns:
[성토량, 절토량, 합계]. [Fill volume, Cutting volume, Total Volume]
초기화.
Initializing volume values and entities.
인스턴스 제거.
Destroys the instance.
측정 영역으로 카메라 이동.
Move camera to volume area.
