Select to view content in your preferred language

Adding widgets to Web AppBuilder

1381
2
03-22-2021 07:01 AM
AndresKasekamp
Emerging Contributor

I am fairly new to web developing and JavaScript, but I want to know how cancustom widgets be added to Web Application after downloading Web AppBuilder. Creating custom widgets from scratch seems to be a pretty long process. Is it possible to add 3D widgets not included in the folder, but there is a JavaScript API reference about them. Can those widgets only be added to the Web Scene or can they be downloaded as a widget folder and added to the application as well? For example, ElevationProfile and LineOfSight.

0 Kudos
2 Replies
LefterisKoumis
Frequent Contributor

For a custom widget, I found it a lot easier to use one of the bare bones widgets that are under the samplewidgets folder located at "<WAB location>\client\stemapp\widgets\samplewidgets". You can modify one these widgets with your code. Then, you can add it in the widgets folder of your app and add an entry in the app's config.json. For other completed widgets like the ElevationProfile, you can  either edit the WAB app or manually add the widget in the widget folder the same way you can do for a custom widget as I described earlier.

 

0 Kudos
AndresKasekamp
Emerging Contributor

Do I have to put that part of the code somewhere in Widget.js ja Widget.html?

https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=widgets-elevat...

0 Kudos