Home:ALL Converter>How to clear directions on Angular google Maps

How to clear directions on Angular google Maps

Ask Time:2019-01-25T14:57:46         Author:Vaibhav Thangriyal

Json Formatter

<agm-map
        [zoom]="mapConfig.zoom"  [styles]="mapConfig.styles" 
        [latitude]="currLate" [longitude]="currLongi"
        >
        <agm-direction *ngIf="path" 
        [origin]="path.origin" 
        [destination]="path.destination"
        [waypoints]="waypoints"
        ></agm-direction>
</agm-map> 

This is my code for implementing directions using Angular Google maps. I gave origin,destination and array of waypoints, the problem is that when i create new route, both old and new routes stays on the maps. But I want to reset/clear the directions so that i can show only the new direction route on the map.

Author:Vaibhav Thangriyal,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54360379/how-to-clear-directions-on-angular-google-maps
yy