Select to view content in your preferred language

How to programmatically clear/reset drawn profiles in <arcgis-elevation-profile>

202
2
Jump to solution
04-13-2025 04:16 AM
EmrahAydemir
Occasional Contributor

Hello ArcGIS Community,

I'm using @arcgis/map-components in a React project to create a 3D map. I need to clear/reset the elevation profiles drawn with <arcgis-elevation-profile> when a button is clicked, but I can't find a documented method to achieve this.

My current setup:

// Elevation Profile component
<arcgis-elevation-profile 
  ref={elevationProfileRef}
></arcgis-elevation-profile>

// Clear button
<calcite-button 
  onClick={() => clearDrawings()} 
  icon-start="trash"
></calcite-button>

 

I need something like this:

  function clearDrawings() {
    try {
      elevationProfileRef.current?.clear();
    } catch (error) {
      console.error("Error clearing drawings:", error);
    }
  }

 

Thanks in advance for your help!

0 Kudos
1 Solution

Accepted Solutions
2 Replies
Sage_Wall
Esri Regular Contributor
EmrahAydemir
Occasional Contributor

Its worked well, thanks you so much...

0 Kudos