title: Remove directions from google map api
body: <p>So I created in Ionic with Google map API, app that shows direction from place A to B.
  But I don't know how to clean it from the map.</p>
  
  <p>I have got a button that starts  startNavigating()</p>
  
  <p>here is my .ts function of this:
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> startNavigating(){
  
      let directionsService = new google.maps.DirectionsService;
      let directionsDisplay = new google.maps.DirectionsRenderer;
      
  
      directionsDisplay.setMap(this.map);
      directionsDisplay.setPanel(this.directionsPanel.nativeElement);
  
      directionsService.route({
          origin: this.StartN,
          destination: this.EndN,
          travelMode: google.maps.TravelMode['DRIVING']
      }, (res, status) =&gt; {
  
          if(status == google.maps.DirectionsStatus.OK){
              directionsDisplay.setDirections(res);
          } else {
              console.warn(status);
          }
  
      });
  
      let mapOptions = {
        zoom: 15,
      }; 
  
    
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I would like to create a button which would start "clean()" and would remove this direction.</p>
  
  <p>Thanks for help!</p>