Direction Widget Clear Route

572
1
Jump to solution
06-14-2021 07:44 PM
JohnPaulAlbana
New Contributor II

Hi,

Is there a way to access the clear route button or function from the directions widget? I am currently looking for a way to clear the route of the directions widget by using a different button or just changing widgets/windows. 

Clear Route.PNG

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor

Tested this out. There's a method on the DirectionsViewModel to clear results.

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsView...

You can use it and it will clear the results in the widget. Here is a sample.

https://codepen.io/odoe/pen/NWpezwb?editors=1000

 

View solution in original post

1 Reply
ReneRubalcava
Frequent Contributor

Tested this out. There's a method on the DirectionsViewModel to clear results.

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsView...

You can use it and it will clear the results in the widget. Here is a sample.

https://codepen.io/odoe/pen/NWpezwb?editors=1000