Example of how to include an ArcGIS API for JavaScript widget in an Experience Builder widget.
The main example here includes the 2D Measurement widget. Click the download button above and extract the files to client\your-extensions\widgets\js-api-widget-wrapper
to see it in action.
If you want to include a widget that is primarily placed as an icon over the map (using view.ui.add()
), like the Compass widget, an example is shown in the compass branch here (download zip). This will be a less-common use case for custom widgets, because the out-of-the-box Experience Builder Map Widget allows you to easily enable/disable these types of widgets in the widget settings.