<?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 to programmatically clear/reset drawn profiles in &amp;lt;arcgis-elevation-profile&amp;gt; in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-programmatically-clear-reset-drawn-profiles/m-p/1605469#M86913</link>
    <description>&lt;P&gt;Hello ArcGIS Community,&lt;/P&gt;&lt;P&gt;I'm using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/" target="_self"&gt;&lt;U&gt;&lt;EM&gt;@arcgis/map-components&lt;/EM&gt;&lt;/U&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in a React project to create a 3D map. I need to clear/reset the elevation profiles drawn with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-elevation-profile/" target="_self"&gt;&lt;U&gt;&lt;EM&gt;&amp;lt;arcgis-elevation-profile&amp;gt;&lt;/EM&gt;&lt;/U&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;when a button is clicked, but I can't find a documented method to achieve this.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My current setup:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Elevation Profile component
&amp;lt;arcgis-elevation-profile 
  ref={elevationProfileRef}
&amp;gt;&amp;lt;/arcgis-elevation-profile&amp;gt;

// Clear button
&amp;lt;calcite-button 
  onClick={() =&amp;gt; clearDrawings()} 
  icon-start="trash"
&amp;gt;&amp;lt;/calcite-button&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I need something like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  function clearDrawings() {
    try {
      elevationProfileRef.current?.clear();
    } catch (error) {
      console.error("Error clearing drawings:", error);
    }
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help!&lt;/P&gt;</description>
    <pubDate>Sun, 13 Apr 2025 11:19:35 GMT</pubDate>
    <dc:creator>EmrahAydemir</dc:creator>
    <dc:date>2025-04-13T11:19:35Z</dc:date>
    <item>
      <title>How to programmatically clear/reset drawn profiles in &lt;arcgis-elevation-profile&gt;</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-programmatically-clear-reset-drawn-profiles/m-p/1605469#M86913</link>
      <description>&lt;P&gt;Hello ArcGIS Community,&lt;/P&gt;&lt;P&gt;I'm using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/" target="_self"&gt;&lt;U&gt;&lt;EM&gt;@arcgis/map-components&lt;/EM&gt;&lt;/U&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in a React project to create a 3D map. I need to clear/reset the elevation profiles drawn with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-elevation-profile/" target="_self"&gt;&lt;U&gt;&lt;EM&gt;&amp;lt;arcgis-elevation-profile&amp;gt;&lt;/EM&gt;&lt;/U&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;when a button is clicked, but I can't find a documented method to achieve this.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My current setup:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Elevation Profile component
&amp;lt;arcgis-elevation-profile 
  ref={elevationProfileRef}
&amp;gt;&amp;lt;/arcgis-elevation-profile&amp;gt;

// Clear button
&amp;lt;calcite-button 
  onClick={() =&amp;gt; clearDrawings()} 
  icon-start="trash"
&amp;gt;&amp;lt;/calcite-button&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I need something like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  function clearDrawings() {
    try {
      elevationProfileRef.current?.clear();
    } catch (error) {
      console.error("Error clearing drawings:", error);
    }
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help!&lt;/P&gt;</description>
      <pubDate>Sun, 13 Apr 2025 11:19:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-programmatically-clear-reset-drawn-profiles/m-p/1605469#M86913</guid>
      <dc:creator>EmrahAydemir</dc:creator>
      <dc:date>2025-04-13T11:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically clear/reset drawn profiles in &lt;arcgis-elevation-profile&gt;</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-programmatically-clear-reset-drawn-profiles/m-p/1605590#M86919</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/603432"&gt;@EmrahAydemir&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You should be able to do this by setting the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ElevationProfile.html#input" target="_self"&gt;input&lt;/A&gt; property to `null`&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/sagewall/pen/JooPGWX?editors=100" target="_blank"&gt;https://codepen.io/sagewall/pen/JooPGWX?editors=100&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 10:47:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-programmatically-clear-reset-drawn-profiles/m-p/1605590#M86919</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2025-04-14T10:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically clear/reset drawn profiles in &lt;arcgis-elevation-profile&gt;</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-programmatically-clear-reset-drawn-profiles/m-p/1605787#M86931</link>
      <description>&lt;P&gt;Its worked well, thanks you so much...&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 19:48:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-programmatically-clear-reset-drawn-profiles/m-p/1605787#M86931</guid>
      <dc:creator>EmrahAydemir</dc:creator>
      <dc:date>2025-04-14T19:48:25Z</dc:date>
    </item>
  </channel>
</rss>

