Name | Type | Description |
---|---|---|
viewer |
DitapViewer | 사용할 DitapViewer 인스턴스.The DitapViewer instance to use. |
apiKey |
string | 일조량 분석에 필요한 API 키.The API key needed for sunshine analysis. |
interactionSunshine |
Object | 일조량 분석을 위한 상호작용 객체.The interaction object for sunshine analysis. |
Example:
// base64 를 URL로 변환하는 함수
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", {
fullscreenButton: true,
baseLayerPicker: true,
// 지형(터레인 지정)
// 디폴트 지형 : Ditap Korea Terrain
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: () => {
return Ditap.NationwideTerrainProvider.create();
},
}),
],
});
try {
const tileset = await Ditap.createOsmBuildingsAsync();
viewer.scene.primitives.add(tileset);
} catch (error) {
console.log(`Error loading tileset: ${error}`);
}
// 뷰어에 추가할 데이터 생성
// 모델 위치로 카메라 이동
viewer.camera.flyTo({
destination: Ditap.Cartesian3.fromDegrees(126.97968, 37.56363, 700),
duration: 1,
orientation: {
heading: Ditap.Math.toRadians(0),
pitch: Ditap.Math.toRadians(-50),
roll: 0,
},
});
// InteractionSunshine 생성
const interactionSunshine = new Ditap.InteractionSunshine(
viewer,
"6VfToXRgNMs9CnW9lKYLAUaWk%2FuHDT745Nf0HytWqOq5CE%2BbKGaaLn2%2FtI4Sx0Sh%2FZutrVvh4YQk9975%2FaQ5Xg%3D%3D"
);
const popup = new Ditap.PopupSunshineAnalysisController(
viewer,
"6VfToXRgNMs9CnW9lKYLAUaWk%2FuHDT745Nf0HytWqOq5CE%2BbKGaaLn2%2FtI4Sx0Sh%2FZutrVvh4YQk9975%2FaQ5Xg%3D%3D",
interactionSunshine
);
popup.open();
Extends
Methods
분석 결과를 팝업 내에 표시합니다.
Displays the analysis results within the popup.
컨텐츠 영역에 요소 추가.
Append element to content.
Append element to content.
Name | Type | Description |
---|---|---|
element |
Element |
추가할 요소. Element to add. |
- Inherited From:
푸터 영역에 요소 추가.
Append element to footer.
Append element to footer.
Name | Type | Description |
---|---|---|
element |
Element | 추가할 요소. Element to add. |
- Inherited From:
헤더 영역에 요소 추가.
Append element to header.
Name | Type | Description |
---|---|---|
element |
Element |
추가할 요소. Element to add. |
- Inherited From:
팝업 닫기.
Closes the popup.
이 객체의 모든 리소스 제거.
Remove all resources of this object.
- Inherited From:
팝업 열기.
Opens the popup.
컨텐츠 영역 맨 앞에 요소 추가.
Prepend element to content.
Name | Type | Description |
---|---|---|
element |
Element |
추가할 요소. Element to add. |
- Inherited From:
푸터 영역 맨 앞에 요소 추가.
Prepend element to footer.
Name | Type | Description |
---|---|---|
element |
Element | 추가할 요소. Element to add. |
- Inherited From:
헤더 영역 맨 앞에 요소 추가.
Prepend element to header.
Prepend element to header.
Name | Type | Description |
---|---|---|
element |
Element |
추가할 요소. Element to add. |
- Inherited From:
컨텐츠 영역의 모든 자식 요소 제거.
Remove all children of content.
- Inherited From:
푸터 영역의 모든 자식 요소 제거.
Remove all children of footer.
- Inherited From:
헤더 영역의 모든 자식 요소 제거.
Remove all children of header.
Remove all children of header.
- Inherited From:
컨텐츠 영역의 자식 요소 제거.
Remove children of content.
Name | Type | Description |
---|---|---|
element |
Element |
제거할 요소. Element to remove. |
- Inherited From:
푸터 영역의 자식 요소 제거.
Remove children of footer.
Name | Type | Description |
---|---|---|
element |
Element | 제거할 요소. Element to remove. |
- Inherited From:
헤더 영역의 자식 요소 제거.
Remove children of header.
Name | Type | Description |
---|---|---|
element |
Element |
제거할 요소. Element to remove. |
- Inherited From:
팝업을 닫을 때 호출되는 콜백 함수를 설정합니다.
Sets the callback function to be called when the popup is closed.
Name | Type | Description |
---|---|---|
callback |
function | 팝업이 닫힐 때 호출될 콜백 함수.The callback function to be called when the popup is closed. |
분석 시작 버튼 클릭 시 일조 분석을 수행합니다.
Performs sunshine analysis when the start button is clicked.
팝업 활성화 on/off 기능.
Function on and off.
Name | Type | Description |
---|---|---|
element |
Element | 매개변수가 없는 경우 wrapper 오픈.If no parameter is entered, toggle wrapper. |
- Inherited From: