事件浏览 / 查看属性

Download code
尝试一下在线预览

在此示例中,您可以交互地探索何时触发各种视图事件。在右侧面板的第二部分,您可以看到在视图中单击或导航时属性如何变化。

仔细观看以下视频,了解在 double-click 后触发了哪些事件:event-explorer

这是您可以在 SceneViewMapView 上侦听事件的方式:

    
1
2
3
4
// Example: Listen to the click event on the view
view.on("click", (event) => {
  console.log("click event: ", event);
});

SceneViewMapView 上观察属性以监听值的变化: 

    
1
2
3
4
// Example: Watch to the scale property
view.watch("scale", (newValue) => {
  console.log("scale property changed: ", newValue);
});

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.