How to use JS API Samples to Make WAB Widget?

5611
7
Jump to solution
06-22-2015 02:00 PM
DanielStoelb
Occasional Contributor III

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.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

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).

View solution in original post

7 Replies
RobertScheitlin__GISP
MVP Emeritus

Daniel,

   Any specific sample? It is not to much of a process depending on the sample.

0 Kudos
DanielStoelb
Occasional Contributor III
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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).

RahmathUnissa
New Contributor II

Hi,

I am trying to figure out on how to covert the below javascript API into WAB widget.  Any suggestions or help?

Drawing tools | ArcGIS API for JavaScript

0 Kudos
StanMcShinsky
Occasional Contributor III

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

JunshanLiu
Occasional Contributor III

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.

JunshanLiu
Occasional Contributor III

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