InteractionSolar

일조권 분석을 위한 사용자 입력(마우스/키보드) 클래스.
User input (mouse/keyboard) class for solar analysis.

new Ditap.InteractionSolar(options)

Name Type Description
options Object 옵션 객체.
Options object.
Name Type Description
viewer DitapViewer DitapViewer 객체.
The DitapViewer instance.
apiKey String 일조권 분석 API 키.
API key for solar analysis.
animation Boolean 일조권 분석 애니메이션 사용 여부.
Flag to enable animation for solar analysis.
Example:
// 샌드캐슬 예제 'DiTAP - Solar' 참조
const viewer = new Ditap.DitapViewer("ditapContainer", {
  fullscreenButton: true,
  baseLayerPicker: true,
});

// 초기 카메라 위치 설정
viewer.camera.setView({
  destination: Ditap.Cartesian3.fromDegrees(
    126.9782349646649,
    37.56671536989183,
    150
  ),
  orientation: {
    heading: Ditap.Math.toRadians(0),
    roll: 0,
  },
});

// 태양 위치에 따른 그림자 효과
viewer.scene.globe.enableLighting = true;
viewer.scene.globe.shadows = true;
viewer.scene.globe.receiveShadows = true;
viewer.shadows = true;
viewer.terrainShadows = Ditap.ShadowMode.ENABLED;

// 지도 밝기 조절
viewer.scene.globe.lightingFadeOutDistance = 10000;
viewer.scene.globe.lightingFadeInDistance = 10000;

// InteractionSolar 생성
const interactionSolar = new Ditap.InteractionSolar({
  viewer: viewer,
  apiKey:
    "6VfToXRgNMs9CnW9lKYLAUaWk%2FuHDT745Nf0HytWqOq5CE%2BbKGaaLn2%2FtI4Sx0Sh%2FZutrVvh4YQk9975%2FaQ5Xg%3D%3D",
  animation: true,
});

const popup = new Ditap.PopupSolarAnalysisController({
  viewer: viewer,
  apiKey:
    "6VfToXRgNMs9CnW9lKYLAUaWk%2FuHDT745Nf0HytWqOq5CE%2BbKGaaLn2%2FtI4Sx0Sh%2FZutrVvh4YQk9975%2FaQ5Xg%3D%3D",
  animation: true,
});

popup.interactionSolar = interactionSolar;

// 모델 좌표
const modelPosition = new Ditap.Cartesian3.fromDegrees(
  126.9782349646649,
  37.56671536989183,
  0
);

// 모델 행렬 생성
const modelMatrix = Ditap.Transforms.eastNorthUpToFixedFrame(modelPosition);

// 모델 인스턴스 생성
const model = await Ditap.Model.fromGltfAsync({
  id: "model_01",
  url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb",
  modelMatrix: modelMatrix,
  minimumPixelSize: 128,
  maximumScale: 3.0,
  scale: 3.0,
});

// 모델 추가
viewer.scene.primitives.add(model);
popup.open();

Members

readonly isOn : boolean

핸들러 비/활성화 상태.
Handler enabled or disabled.

viewer : DitapViewer

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

Methods

_addMarker(position)

내부에서 마커 엔티티를 추가하고 ditapStorage에 등록합니다.
Adds a marker entity at the specified position and registers it in ditapStorage.
Name Type Description
position Cartesian3 분석 지점 좌표.
Analysis point position.

_clearMarkers()

등록된 마커들을 ditapStorage에서 제거합니다.
Removes all registered marker entities from ditapStorage.

cancel()

핸들러 취소 (초기화 후 종료).
Cancel handler (exit after initialization).

getSelectedPoint()Array.<Cartesian3>

선택된 분석 지점을 반환합니다.
Returns the array of selected analysis points.
Returns:
선택된 분석 지점 배열.
Array of selected analysis points.

off()

핸들러 종료.
End handler.

on()

마우스 이벤트 핸들러를 생성하여 일조권 분석 모드를 활성화합니다.
Creates mouse (or touch) event handlers and activates the solar analysis mode.