autodesk-forgeautodesk-viewerforgeviewer

Autodesk Forge v7: Event Listeners in ES6 Classes


I followed this tutorial, and I checked the documentation and onToolCreated should have something to do with TOOLBAR_CREATED_EVENT. But the other events don't work for me, like onExplodeChanged(). I even checked on the console and it says that Autodesk.Viewing.EXPLODE_CHANGE_EVENT = "explodeChanged" and Autodesk.Viewing.TOOLBAR_CREATED_EVENT = "toolbarCreated". What's going on?


Solution

  • Unfortunately, there is no equality between onExplodeChanged and Autodesk.Viewing.EXPLODE_CHANGE_EVENT. You need to register your event handler of Autodesk.Viewing.EXPLODE_CHANGE_EVENT in your extension or somewhere in your app yourself.

    The Extension#onToolbarCreated is a special cause. It's introduced since Forge Viewer v7. See Migration Guide v6 to v7