Is there any easy way to take a JS API sample and convert it to a WAB Widget? I'm taking a look at a few samples out there and it would be great to take that pre-existing sample code and convert it into a widget to work with WAB.
Solved! Go to Solution.
Daniel,
You can use this zip file as an example of how I convert a sample into a widget (the add shapefile sample you mentioned).
Daniel,
Any specific sample? It is not to much of a process depending on the sample.
This one for example: Add shapefile | ArcGIS API for JavaScript
Hi,
I am trying to figure out on how to covert the below javascript API into WAB widget. Any suggestions or help?
Rahmath,
Here is a resource that you may be aware of Web AppBuilder Developer Edition – Customization Resource List . This is a living document of widgets and other help that are available from the the community for Web appbuilder. In this list there are a few drawing tools people have made that you might find useful. There is even one that is similar to the link you shared.
If you have more questions then it would be good to start another thread so we dont get off topic from this original question. Hope this helps some.
-Stan
You can wrap this sample as a Dojo dijit and then use it in your widget. But, in fact we have already had a dijit that has the similar function you want, you can find it at stemapp/jimu.js/dijit/DrawBox.
I think you need to follow the widget developer guide to create a new widget, it's easy to follow. And, we have some sample widgets in the release package, you can start from there very quickly.
About wrap the sample, I think this section may be useful for you:
Use dojo dijit—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers