<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Assistance with Custom Widget for Portal App in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/assistance-with-custom-widget-for-portal-app/m-p/579747#M15508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are a gentleman and a scholar &lt;A href="https://community.esri.com/migrated-users/3101"&gt;Robert Scheitlin, GISP&lt;/A&gt; This is fantastic. Thanks for going the extra mile and providing the completed (and working quite well) widget. I'll play around with the code you have provided and see if I can incorportate some of USGS's other sample extensions like reporting, summaries, etc into the trace results. Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Adding a tweaked version of the widget that Robert provided in case anyone is interested in this functionality using the USGS Streamer API. There's still a few things I'm woking on such as getting the trace segments merged in the layer widget so that they can be used as a single layer for buffering, and additional analysis, as well as a option to clear previous traces in the widget itself, however for the most part it is functional! Thanks again for all of the help on this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Streamer Widget" class="jive-emoji image-1 jive-image j-img-original" src="/legacyfs/online/479849_streamer 1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Streamer Trace Upstream" class="jive-emoji jive-image image-2 j-img-original" src="https://community.esri.com/legacyfs/online/479850_streamer2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jan 2020 17:42:34 GMT</pubDate>
    <dc:creator>RexRobichaux</dc:creator>
    <dc:date>2020-01-27T17:42:34Z</dc:date>
    <item>
      <title>Assistance with Custom Widget for Portal App</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/assistance-with-custom-widget-for-portal-app/m-p/579745#M15506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello GeoNet and widget gurus! Let me fully disclose that I'm not a developer nor anything close to it... but I'm trying to accomplish something that I think is fairly straightforward for someone with basic JS and widget development experience and needless to say I'm stuck with the following after adding my best attempt to our Portal dev web app:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Uncaught TypeError: Cannot read property 'name' of undefined&lt;BR /&gt; at Object.&amp;lt;anonymous&amp;gt; (Widget.js?wab_dv=2.15:68)&lt;BR /&gt; at Object.&amp;lt;anonymous&amp;gt; (init.js:64)&lt;BR /&gt; at Object.c [as onwidget-created] (init.js:120)&lt;BR /&gt; at Function.m.emit (init.js:126)&lt;BR /&gt; at Function.m.emit (init.js:127)&lt;BR /&gt; at Object.emit (init.js:119)&lt;BR /&gt; at Object.&amp;lt;anonymous&amp;gt; (WidgetManager.js?wab_dv=2.15:132)&lt;BR /&gt; at init.js:64&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Long story short, we have an internal environmental sciences web application running on Portal that I extend and support here and there using WABD 2.15. I'm trying to build a simple widget, that when opened, prompts a user to select a location / point on the map. Once the click event occurs, I simply want to reach out to the USGS streamer API located here:&amp;nbsp;&lt;A class="link-titled" href="https://txpub.usgs.gov/DSS/streamer/api/3.14/web/index.html#tab3?sample10" title="https://txpub.usgs.gov/DSS/streamer/api/3.14/web/index.html#tab3?sample10" rel="nofollow noopener noreferrer" target="_blank"&gt;USGS - Streamer Trace API&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally, I'd like to configure my widget.html to simply prompt the user to select the point on the map and select up stream trace or down stream trace, and then for the widget.js file to contain the JS logic to run the operation using their provided code in the link above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a simple way to transform the USGS example code below to a actionable widget in a WABD app? I've given it a shot but I'm sure there are multiple errors in my widget.js syntax as is currently. Here is the full html that I used as a starting point:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;html&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="" style="color: #008000;"&gt;&amp;lt;!-- HTML HEAD --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;head&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;meta&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ff0000;"&gt;http-equiv&lt;/SPAN&gt;="Content-Type" &lt;SPAN class="" style="color: #ff0000;"&gt;content&lt;/SPAN&gt;="text/html; charset=utf-8"&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;title&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;Streamer Trace API: Sample #10&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;title&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
        
        &lt;SPAN class="" style="color: #008000;"&gt;&amp;lt;!-- ESRI JSAPI 3.14 --&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;link&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ff0000;"&gt;rel&lt;/SPAN&gt;="stylesheet" &lt;SPAN class="" style="color: #ff0000;"&gt;href&lt;/SPAN&gt;="https://js.arcgis.com/3.14/esri/css/esri.css"&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;script&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ff0000;"&gt;type&lt;/SPAN&gt;="text/javascript" &lt;SPAN class="" style="color: #ff0000;"&gt;src&lt;/SPAN&gt;="https://js.arcgis.com/3.14/"&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;script&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
        
        &lt;SPAN class="" style="color: #008000;"&gt;&amp;lt;!-- Streamer Trace JSAPI 3.14 --&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;script&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ff0000;"&gt;type&lt;/SPAN&gt;="text/javascript" &lt;SPAN class="" style="color: #ff0000;"&gt;src&lt;/SPAN&gt;="https://txpub.usgs.gov/DSS/Streamer/api/3.14/js/trace_api.min.js"&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;script&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
        
        &lt;SPAN class="" style="color: #008000;"&gt;&amp;lt;!-- css styling --&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;style&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ff0000;"&gt;type&lt;/SPAN&gt;="text/css"&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;
            &lt;SPAN class="" style="color: #0000ff;"&gt;html&lt;/SPAN&gt;, &lt;SPAN class="" style="color: #0000ff;"&gt;body&lt;/SPAN&gt;, &lt;SPAN class="" style="color: #0000ff;"&gt;#map&lt;/SPAN&gt; {
                &lt;SPAN class="" style="color: #ff0000;"&gt;height&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 100%&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;width&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 100%&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;margin&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 0px&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;padding&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 0px&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;overflow&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; hidden&lt;/SPAN&gt;;
            }
            &lt;SPAN class="" style="color: #0000ff;"&gt;#HomeButton&lt;/SPAN&gt; {
                &lt;SPAN class="" style="color: #ff0000;"&gt;position&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; absolute&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;left&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 20px&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;top&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 90px&lt;/SPAN&gt;;
            }
            &lt;SPAN class="" style="color: #0000ff;"&gt;#description&lt;/SPAN&gt;, &lt;SPAN class="" style="color: #0000ff;"&gt;#controls&lt;/SPAN&gt; {
                &lt;SPAN class="" style="color: #ff0000;"&gt;position&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; absolute&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;background&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; rgba(255,255,255,0.8)&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;border&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 1px solid black&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;border-radius&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 5px&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;padding&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 10px&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;font-family&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; Arial, Helvetica, sans-serif&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;z-index&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 99&lt;/SPAN&gt;;
            }
            &lt;SPAN class="" style="color: #0000ff;"&gt;#description&lt;/SPAN&gt; {
                &lt;SPAN class="" style="color: #ff0000;"&gt;right&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 20px&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;top&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 20px&lt;/SPAN&gt;;
            }
            &lt;SPAN class="" style="color: #0000ff;"&gt;#controls&lt;/SPAN&gt; {
                &lt;SPAN class="" style="color: #ff0000;"&gt;left&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 70px&lt;/SPAN&gt;;
                &lt;SPAN class="" style="color: #ff0000;"&gt;top&lt;/SPAN&gt;:&lt;SPAN class="" style="color: #a31515;"&gt; 20px&lt;/SPAN&gt;;
            }
        &lt;/SPAN&gt;&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;style&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
        
        &lt;SPAN class="" style="color: #008000;"&gt;&amp;lt;!-- main JavaScript --&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;script&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ff0000;"&gt;type&lt;/SPAN&gt;="text/javascript"&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;
            &lt;SPAN class="" style="color: #0000ff;"&gt;require&lt;/SPAN&gt;( [&lt;SPAN class="" style="color: #a31515;"&gt;"esri/map"&lt;/SPAN&gt;,&lt;SPAN class="" style="color: #a31515;"&gt;"esri/dijit/HomeButton"&lt;/SPAN&gt;,&lt;SPAN class="" style="color: #a31515;"&gt;"dojo/domReady!"&lt;/SPAN&gt;], &lt;SPAN class="" style="color: #0000ff;"&gt;function&lt;/SPAN&gt;(Map,HomeButton) {
                &lt;SPAN class="" style="color: #008000;"&gt;// create map&lt;/SPAN&gt;
                &lt;SPAN class="" style="color: #008000;"&gt;// since we'll add a trace_api basemap, set the map LevelsOfDetail (zoom levels) to the API basemapLODs&lt;/SPAN&gt;
                &lt;SPAN class="" style="color: #0000ff;"&gt;var&lt;/SPAN&gt; map = &lt;SPAN class="" style="color: #0000ff;"&gt;new&lt;/SPAN&gt; Map(&lt;SPAN class="" style="color: #a31515;"&gt;"map"&lt;/SPAN&gt;, {
                    &lt;SPAN class="" style="color: #a31515;"&gt;"center"&lt;/SPAN&gt;          : [-99,38],
                    &lt;SPAN class="" style="color: #a31515;"&gt;"zoom"&lt;/SPAN&gt;            : 1,
                    &lt;SPAN class="" style="color: #a31515;"&gt;"lods"&lt;/SPAN&gt;            : trace_api.basemapLODs,
                    &lt;SPAN class="" style="color: #a31515;"&gt;"showAttribution"&lt;/SPAN&gt; : false,
                    &lt;SPAN class="" style="color: #a31515;"&gt;"logo"&lt;/SPAN&gt;            : false
                });
                
                &lt;SPAN class="" style="color: #008000;"&gt;// add "home" navigation button (zooms to initial extent when clicked)&lt;/SPAN&gt;
                ( &lt;SPAN class="" style="color: #0000ff;"&gt;new&lt;/SPAN&gt; HomeButton( {&lt;SPAN class="" style="color: #a31515;"&gt;"map"&lt;/SPAN&gt;:map}, &lt;SPAN class="" style="color: #a31515;"&gt;"HomeButton"&lt;/SPAN&gt;) ).startup();
                
                &lt;SPAN class="" style="color: #008000;"&gt;// connect Trace API "trace-complete" event handler&lt;/SPAN&gt;
                trace_api.on( &lt;SPAN class="" style="color: #a31515;"&gt;"trace-complete"&lt;/SPAN&gt;, &lt;SPAN class="" style="color: #0000ff;"&gt;function&lt;/SPAN&gt;() {
                    &lt;SPAN class="" style="color: #008000;"&gt;// give an alert if addTrace failed&lt;/SPAN&gt;
                    &lt;SPAN class="" style="color: #0000ff;"&gt;if&lt;/SPAN&gt; ( trace_api.lastAddTraceFailure() ) {
                        &lt;SPAN class="" style="color: #008000;"&gt;// there is a failure message - give alert&lt;/SPAN&gt;
                        alert( &lt;SPAN class="" style="color: #a31515;"&gt;"trace_api.on 'trace-complete': Trace could not be added to map.\nReason:\n\n"&lt;/SPAN&gt; + trace_api.lastAddTraceFailure() + &lt;SPAN class="" style="color: #a31515;"&gt;"\n\n"&lt;/SPAN&gt; );
                    }
                });
                
                &lt;SPAN class="" style="color: #008000;"&gt;// add trace_api basemap, USA mask, and set map on-click callback when the trace_api is loaded&lt;/SPAN&gt;
                trace_api.on(&lt;SPAN class="" style="color: #a31515;"&gt;"load"&lt;/SPAN&gt;, &lt;SPAN class="" style="color: #0000ff;"&gt;function&lt;/SPAN&gt;() {
                    &lt;SPAN class="" style="color: #008000;"&gt;// add the Trace API "imagery" basemap&lt;/SPAN&gt;
                    trace_api.addBasemap({
                        &lt;SPAN class="" style="color: #a31515;"&gt;"map"&lt;/SPAN&gt;     : map,       &lt;SPAN class="" style="color: #008000;"&gt;// map to use&lt;/SPAN&gt;
                        &lt;SPAN class="" style="color: #a31515;"&gt;"basemap"&lt;/SPAN&gt; : &lt;SPAN class="" style="color: #a31515;"&gt;"imagery"&lt;/SPAN&gt;, &lt;SPAN class="" style="color: #008000;"&gt;// ESRI "World Imagery" basemap with Streamer's traceable streams &amp;amp; labels&lt;/SPAN&gt;
                        &lt;SPAN class="" style="color: #a31515;"&gt;"opacity"&lt;/SPAN&gt; : 0.9        &lt;SPAN class="" style="color: #008000;"&gt;// opacity (0-1, 1=100% opaque)&lt;/SPAN&gt;
                    });
                    
                    &lt;SPAN class="" style="color: #008000;"&gt;// add gray mask of the United States&lt;/SPAN&gt;
                    trace_api.toggleUsaMask({
                        &lt;SPAN class="" style="color: #a31515;"&gt;"map"&lt;/SPAN&gt;     : map,  &lt;SPAN class="" style="color: #008000;"&gt;// map to use&lt;/SPAN&gt;
                        &lt;SPAN class="" style="color: #a31515;"&gt;"visible"&lt;/SPAN&gt; : true, &lt;SPAN class="" style="color: #008000;"&gt;// toggle visible&lt;/SPAN&gt;
                        &lt;SPAN class="" style="color: #a31515;"&gt;"opacity"&lt;/SPAN&gt; : 0.7   &lt;SPAN class="" style="color: #008000;"&gt;// opacity (0-1, 1=100% opaque)&lt;/SPAN&gt;
                    });
                    
                    &lt;SPAN class="" style="color: #008000;"&gt;// set map on-click callback&lt;/SPAN&gt;
                    map.on(&lt;SPAN class="" style="color: #a31515;"&gt;"click"&lt;/SPAN&gt;, &lt;SPAN class="" style="color: #0000ff;"&gt;function&lt;/SPAN&gt;(evt) {
                        &lt;SPAN class="" style="color: #008000;"&gt;// get trace direction currently selected in drop-down menu&lt;/SPAN&gt;
                        &lt;SPAN class="" style="color: #0000ff;"&gt;var&lt;/SPAN&gt; traceDir = &lt;SPAN class="" style="color: #0000ff;"&gt;document&lt;/SPAN&gt;.getElementById(&lt;SPAN class="" style="color: #a31515;"&gt;"menu_traceDir"&lt;/SPAN&gt;);
                        traceDir = traceDir.options[traceDir.selectedIndex].text;
                        
                        &lt;SPAN class="" style="color: #008000;"&gt;// add trace using the trace_api.addTrace() method with desired options&lt;/SPAN&gt;
                        trace_api.addTrace({
                            &lt;SPAN class="" style="color: #a31515;"&gt;"map"&lt;/SPAN&gt;            : map,            &lt;SPAN class="" style="color: #008000;"&gt;// map to use&lt;/SPAN&gt;
                            &lt;SPAN class="" style="color: #008000;"&gt;// ...parameters defining the stream trace to add...&lt;/SPAN&gt;
                            &lt;SPAN class="" style="color: #a31515;"&gt;"x"&lt;/SPAN&gt;              : evt.mapPoint.x, &lt;SPAN class="" style="color: #008000;"&gt;// set trace origin x-coord to the map click&lt;/SPAN&gt;
                            &lt;SPAN class="" style="color: #a31515;"&gt;"y"&lt;/SPAN&gt;              : evt.mapPoint.y, &lt;SPAN class="" style="color: #008000;"&gt;// set trace origin y-coord to the map click&lt;/SPAN&gt;
                            &lt;SPAN class="" style="color: #a31515;"&gt;"xy_wkid"&lt;/SPAN&gt;        : evt.mapPoint.spatialReference.wkid, &lt;SPAN class="" style="color: #008000;"&gt;// map-click coord spatial reference wkid&lt;/SPAN&gt;
                            &lt;SPAN class="" style="color: #a31515;"&gt;"traceDir"&lt;/SPAN&gt;       : traceDir,       &lt;SPAN class="" style="color: #008000;"&gt;// direction of stream trace (must be "up" or "down")&lt;/SPAN&gt;
                            &lt;SPAN class="" style="color: #008000;"&gt;// ...additional trace options...&lt;/SPAN&gt;
                            &lt;SPAN class="" style="color: #a31515;"&gt;"originPoint"&lt;/SPAN&gt;    : &lt;SPAN class="" style="color: #a31515;"&gt;"infoHover"&lt;/SPAN&gt;,    &lt;SPAN class="" style="color: #008000;"&gt;// add point graphic to trace origin with mouse-hover info window&lt;/SPAN&gt;
                            &lt;SPAN class="" style="color: #a31515;"&gt;"clearOldTraces"&lt;/SPAN&gt; : true            &lt;SPAN class="" style="color: #008000;"&gt;// clear any existing map traces before trying to add the new one&lt;/SPAN&gt;
                        });
                    }); &lt;SPAN class="" style="color: #008000;"&gt;// end map.on "click"&lt;/SPAN&gt;
                }); &lt;SPAN class="" style="color: #008000;"&gt;// end trace_api.on "load"&lt;/SPAN&gt;
                
            }); &lt;SPAN class="" style="color: #008000;"&gt;// end require&lt;/SPAN&gt;
        &lt;/SPAN&gt;&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;script&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;head&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    
    &lt;SPAN class="" style="color: #008000;"&gt;&amp;lt;!-- HTML BODY --&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;body&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #008000;"&gt;&amp;lt;!-- description --&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;div&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ff0000;"&gt;id&lt;/SPAN&gt;="description"&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;b&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;SAMPLE 10:&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;b&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt; Adding a trace by clicking the map
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;div&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
        
        &lt;SPAN class="" style="color: #008000;"&gt;&amp;lt;!-- controls --&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;div&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ff0000;"&gt;id&lt;/SPAN&gt;="controls"&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;p&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;b&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;(1)&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;b&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt; Choose a trace direction:
                &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;select&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ff0000;"&gt;id&lt;/SPAN&gt;="menu_traceDir" &amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;option&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;down&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;option&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;option&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;up  &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;option&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;select&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;p&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;p&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;b&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;(2)&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;b&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt; Click a stream on the map to start a trace
            &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;p&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;div&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
        
        &lt;SPAN class="" style="color: #008000;"&gt;&amp;lt;!-- map --&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;div&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ff0000;"&gt;id&lt;/SPAN&gt;="map"&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;div&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
        
        &lt;SPAN class="" style="color: #008000;"&gt;&amp;lt;!-- home button --&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;&lt;SPAN class="" style="color: #a31515;"&gt;div&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ff0000;"&gt;id&lt;/SPAN&gt;="HomeButton"&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;div&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;body&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    
&lt;SPAN class="" style="color: #0000ff;"&gt;&amp;lt;/&lt;SPAN class="" style="color: #a31515;"&gt;html&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Thanks for any assistance you can provide!&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3101" target="_blank"&gt;Robert Scheitlin, GISP&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:55:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/assistance-with-custom-widget-for-portal-app/m-p/579745#M15506</guid>
      <dc:creator>RexRobichaux</dc:creator>
      <dc:date>2021-12-12T00:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with Custom Widget for Portal App</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/assistance-with-custom-widget-for-portal-app/m-p/579746#M15507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; It is not that complicated for an experienced developer but could throw a beginner for a loop.&lt;/P&gt;&lt;P&gt;First thing to figure out is how to add the USGS library (i.e. the js file from them). to do that you have to follow the help doc for &lt;A href="https://developers.arcgis.com/web-appbuilder/sample-code/add-a-third-party-library.htm"&gt;adding other libraries&lt;/A&gt;. Next you have to figure out what goes in the widget.html and the widget.js files. Attached I have the widget working for you to study and use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2020 16:50:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/assistance-with-custom-widget-for-portal-app/m-p/579746#M15507</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-01-27T16:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with Custom Widget for Portal App</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/assistance-with-custom-widget-for-portal-app/m-p/579747#M15508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are a gentleman and a scholar &lt;A href="https://community.esri.com/migrated-users/3101"&gt;Robert Scheitlin, GISP&lt;/A&gt; This is fantastic. Thanks for going the extra mile and providing the completed (and working quite well) widget. I'll play around with the code you have provided and see if I can incorportate some of USGS's other sample extensions like reporting, summaries, etc into the trace results. Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Adding a tweaked version of the widget that Robert provided in case anyone is interested in this functionality using the USGS Streamer API. There's still a few things I'm woking on such as getting the trace segments merged in the layer widget so that they can be used as a single layer for buffering, and additional analysis, as well as a option to clear previous traces in the widget itself, however for the most part it is functional! Thanks again for all of the help on this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Streamer Widget" class="jive-emoji image-1 jive-image j-img-original" src="/legacyfs/online/479849_streamer 1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Streamer Trace Upstream" class="jive-emoji jive-image image-2 j-img-original" src="https://community.esri.com/legacyfs/online/479850_streamer2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2020 17:42:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/assistance-with-custom-widget-for-portal-app/m-p/579747#M15508</guid>
      <dc:creator>RexRobichaux</dc:creator>
      <dc:date>2020-01-27T17:42:34Z</dc:date>
    </item>
  </channel>
</rss>

