Skip to content

In this sample you can interactively explore when various events are fired on a component. In the second part of the right panel you can see how the properties change when you click or navigate in the view.

This is how you can listen to events on a Scene or Map component:

// Example: listen to the click event
viewElement.addEventListener("arcgisViewClick", (event) => {
console.log("click event: ", event);
});

Watch properties on a Scene or Map component to listen to value changes:

// Example: watch to the scale property
reactiveUtils.watch(
() => viewElement.scale,
(scale) => console.log("scale property changed: ", scale),
);