<?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 How do I use a widget to clear or remove drawings and layers? in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799496#M5034</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've copied the geoprocessing widget and set it up in web appbuilder to run a geoprocessing service that asks the user for an input polygon.&amp;nbsp; After a successful run I want the tool to clear the map graphics and close the widget window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's asynchronous so I'm editing the onJobComplete method within Widget.js.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed instructions&amp;nbsp;&lt;A href="https://developers.arcgis.com/web-appbuilder/sample-code/close-widget-programmatically.htm"&gt;here&lt;/A&gt;&amp;nbsp;to close the widget panel and that's working successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears the widget uses a draw tools box within the editor.&amp;nbsp; I'm not sure if I should just "click" the clear button or if there is a better solution..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I click the button using the attach-point name btnClear?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jul 2019 14:25:20 GMT</pubDate>
    <dc:creator>MichaelMitchell5</dc:creator>
    <dc:date>2019-07-16T14:25:20Z</dc:date>
    <item>
      <title>How do I use a widget to clear or remove drawings and layers?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799496#M5034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've copied the geoprocessing widget and set it up in web appbuilder to run a geoprocessing service that asks the user for an input polygon.&amp;nbsp; After a successful run I want the tool to clear the map graphics and close the widget window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's asynchronous so I'm editing the onJobComplete method within Widget.js.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed instructions&amp;nbsp;&lt;A href="https://developers.arcgis.com/web-appbuilder/sample-code/close-widget-programmatically.htm"&gt;here&lt;/A&gt;&amp;nbsp;to close the widget panel and that's working successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears the widget uses a draw tools box within the editor.&amp;nbsp; I'm not sure if I should just "click" the clear button or if there is a better solution..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I click the button using the attach-point name btnClear?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2019 14:25:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799496#M5034</guid>
      <dc:creator>MichaelMitchell5</dc:creator>
      <dc:date>2019-07-16T14:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the geoprocessing widget to clear drawing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799497#M5035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can sort through all the this.map.graphicsLayerIds but I can't get anything for this.map.layers.&amp;nbsp; It's undefined.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2019 20:08:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799497#M5035</guid>
      <dc:creator>MichaelMitchell5</dc:creator>
      <dc:date>2019-07-17T20:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the geoprocessing widget to clear drawing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799498#M5036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;In your widget you&amp;nbsp;just call&amp;nbsp;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;SPAN style="color: #569cd6;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe; "&gt;drawBox.&lt;/SPAN&gt;_onClickClear();&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 13:14:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799498#M5036</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-07-22T13:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the geoprocessing widget to clear drawing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799499#M5037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got an error and it shows that drawBox is undefined.&amp;nbsp; What exactly is "this" referring to in this context?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 19:14:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799499#M5037</guid>
      <dc:creator>MichaelMitchell5</dc:creator>
      <dc:date>2019-07-22T19:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the geoprocessing widget to clear drawing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799500#M5038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; This refers to the current code scope.&amp;nbsp; You need to use lang.hitch to maintain current code scope to the widget itself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 19:22:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799500#M5038</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-07-22T19:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the geoprocessing widget to clear drawing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799501#M5039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to do a bit of reading on lang.hitch.&lt;/P&gt;&lt;P&gt;The widgets onJobComplete is called using lang.hitch().&amp;nbsp; I attempt to call this.drawBox_onClickClear() within onJobComplete but&amp;nbsp;"this" has no reference to drawBox.&amp;nbsp; It does have a reference to drawTools and drawTools[0] is the drawBox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this.drawTools[0]._onClickClear() did the trick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a more elegant way to reference that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2019 14:28:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799501#M5039</guid>
      <dc:creator>MichaelMitchell5</dc:creator>
      <dc:date>2019-07-23T14:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the geoprocessing widget to clear drawing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799502#M5040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually no that is the correct way, as the GP widget can have multiple drawBox widgets it maintains them in an array unlike other widgets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to mark this question as answered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2019 15:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799502#M5040</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-07-23T15:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a widget to clear or remove drawings and layers?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799503#M5041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just in case you need loop layers in the map object, use &lt;STRONG&gt;this.map_layers&lt;/STRONG&gt; would work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2019 03:42:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-do-i-use-a-widget-to-clear-or-remove-drawings/m-p/799503#M5041</guid>
      <dc:creator>LeoLiu1</dc:creator>
      <dc:date>2019-08-06T03:42:04Z</dc:date>
    </item>
  </channel>
</rss>

