Name | Type | Description |
---|---|---|
viewer |
Object | 사용할 Viewer 인스턴스.The Viewer instance to use. |
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,
},
});
const popup = new Ditap.PopupSunshineAnalysisController(
viewer,
"6VfToXRgNMs9CnW9lKYLAUaWk%2FuHDT745Nf0HytWqOq5CE%2BbKGaaLn2%2FtI4Sx0Sh%2FZutrVvh4YQk9975%2FaQ5Xg%3D%3D",
);
popup.open();
Methods
_generateTimeSteps(startTime, endTime, intervalMinutes) → Array.<JulianDate>
시작 시간과 종료 시간 사이를 intervalMinutes 간격으로 나눈 JulianDate 배열을 생성합니다.
Generates an array of JulianDate time steps between the start and end times, divided by the given interval in minutes.
Name | Type | Description |
---|---|---|
startTime |
string | ISO8601 형식의 시작 시간.Start time in ISO8601. |
endTime |
string | ISO8601 형식의 종료 시간.End time in ISO8601. |
intervalMinutes |
number | 시간 간격(분).Interval in minutes. |
Returns:
생성된 시간 스텝 배열.Array of generated JulianDate time steps.
객체 형태의 파라미터를 URL 쿼리 문자열로 직렬화합니다.
Serializes an object of parameters into a URL query string.
Name | Type | Description |
---|---|---|
params |
Object | 파라미터 객체.Object containing query parameters. |
Returns:
직렬화된 쿼리 문자열.Serialized query string.
모든 분석 결과 시각화 엔티티를 제거합니다.
Clears all visualization entities added during the analysis.
인스턴스 제거.
Removes the instance.
분석 지점의 위치와 선택한 날짜(동지 날짜)를 기반으로 일출/일몰 정보를 가져옵니다.
Retrieves sunrise and sunset information based on the positions of the analysis points and the selected date.
async performAnalysis(points, startTime, endTime, intervalMinutesArray, apiKey) → Promise.<Array.<Object>>
지정된 지점들에 대해 주어진 시간 범위 내 태양 위치와 레이캐스팅을 통해 일조 여부를 판정합니다.
Determines the sunlight status for given points over the specified time range by computing the sun position and performing raycasting.
Name | Type | Description |
---|---|---|
points |
Array.<Cartesian3> | 분석할 지점 배열.Array of points to analyze. |
startTime |
string | ISO8601 형식의 시작 시간 (예: "2025-02-20T00:00:00+09:00").Start time in ISO8601. |
endTime |
string | ISO8601 형식의 종료 시간 (예: "2025-02-20T23:59:59+09:00").End time in ISO8601. |
intervalMinutesArray |
Array.<number> | 각 지점별 시간 간격(분) 배열.Array of time intervals (in minutes) for each point. |
apiKey |
string | API 키 (인코딩된 형식일 수 있음).API key (may be encoded). |
Returns:
각 지점의 시간별 일조 여부 결과 배열.Array of sunlight analysis results per point.