Stay organized with collections
Save and categorize content based on your preferences.
This page describes the user interface events and error events that you can
listen for and handle programmatically.
User Interface Events
This section outlines the interactive events and state change notifications you
can listen for and handle programmatically when working with 3D maps. JavaScript
within the browser is event-driven, meaning it responds to user interactions by
generating events that your program can listen to and execute code accordingly.
There are two main types of events:
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
sample.
State change notifications reflect updates to the underlying 3D map data
models and rendering state, using a conventional gmp-propertychange naming
scheme.
Each 3D mapping API object exposes a set of named events that your program can
register event listeners for and execute logic when those events occur using the
built-in addEventListener() function.
The following sample shows which events are triggered as a user interacts with
the map:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-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:"]]