이 페이지에서는 수신 대기 및 프로그래매틱 방식으로 처리할 수 있는 사용자 인터페이스 이벤트와 오류 이벤트를 설명합니다.
사용자 인터페이스 이벤트
이 섹션에서는 3D 지도 사용 시 수신 대기하고 프로그래매틱 방식으로 처리할 수 있는 대화형 이벤트 및 상태 변경 알림을 간략히 설명합니다. 브라우저의 JavaScript는 이벤트 기반입니다. 즉, 프로그램이 수신 대기하고 그에 따라 코드를 실행할 수 있는 이벤트를 생성하여 사용자 상호작용에 응답합니다.
두 가지 기본 이벤트 유형이 있습니다.
사용자 상호작용 이벤트 (예: 마우스 클릭)는 3D 지도 표시 영역에서 코드로 전파됩니다. 이러한 이벤트를 통해 3D 지도 환경 내에서 직접적인 사용자 작업에 응답할 수 있습니다. 샘플 보기
상태 변경 알림은 기존의 gmp-propertychange 이름 지정 체계를 사용하여 기본 3D 지도 데이터 모델 및 렌더링 상태에 대한 업데이트를 반영합니다.
각 3D 매핑 API 객체는 기본 제공 addEventListener() 함수를 사용하여 이벤트가 발생할 때 프로그램이 이벤트 리스너를 등록하고 로직을 실행할 수 있는 이름이 지정된 이벤트 집합을 노출합니다.
[null,null,["최종 업데이트: 2025-04-29(UTC)"],[],[],null,["\u003cbr /\u003e\n\n| This product or feature is in Preview (pre-GA). Pre-GA products and features might have limited support, and changes to pre-GA products and features might not be compatible with other pre-GA versions. Pre-GA Offerings are covered by the [Google\n| Maps Platform Service Specific Terms](https://cloud.google.com/maps-platform/terms/maps-service-terms). For more information, see the [launch stage\n| descriptions](/maps/launch-stages).\n\n\u003cbr /\u003e\n\nThis page describes the user interface events and error events that you can\nlisten for and handle programmatically.\n\nUser Interface Events\n\nThis section outlines the interactive events and state change notifications you\ncan listen for and handle programmatically when working with 3D maps. JavaScript\nwithin the browser is event-driven, meaning it responds to user interactions by\ngenerating events that your program can listen to and execute code accordingly.\n\nThere are two main types of events:\n\n- User interaction events (such as mouse clicks) are propagated from the 3D map viewport to your code. These events allow you to respond to direct user actions within the 3D map environment. [View\n sample](/maps/documentation/javascript/examples/3d/polygon-click-event).\n- State change notifications reflect updates to the underlying 3D map data models and rendering state, using a conventional `gmp-propertychange` naming scheme.\n\nEach 3D mapping API object exposes a set of named events that your program can\nregister event listeners for and execute logic when those events occur using the\nbuilt-in `addEventListener()` function.\n\nThe following sample shows which events are triggered as a user interacts with\nthe map:"]]