title: refresh waypoints on directions_changed
body: <p>I made myself a routes manager with a couple of options (like avoidTolls, travelMode, avoidHighways, waypoints) and draggable routes.</p>
  
  <p>I Created <code>var lastRequest = []</code> to store <code>DirectionsRequest properties</code> from the last render.</p>
  
  <p>The code looks like this:</p>
  
  <pre><code>directionsService.route(request, function(response, status) {
      if (status == google.maps.DirectionsStatus.OK) {
          var directions = parseDirections(response, mode, tolls)
          directionsDisplay.setDirections(response)
      }
  });
  
  google.maps.event.addListener(directionsDisplay, 'directions_changed', function() {
      refreshReq(directionsDisplay.getDirections())
  })
  
  function refreshReq(response)
  {
      //
  }
  </code></pre>
  
  <p>I'm stuck finding a solution to refresh on <code>directions_changed</code> my <code>lastRequest['waypoints']</code> with new data from a <code>response</code> so my script will be able to store a waypoints object and redo <code>lastRequest</code> any time I want.</p>
  
  <p>Difficulty comes when I take from <code>response</code> the waypoints Array like I need.</p>
  
  <p><strong>Tried couple variants:</strong><br>
  <code>lastRequest['waypoints'] = response['routes'][0]['legs'][0]['via_waypoints']</code><br>
  but that was not that.</p>
  
  <p>Next step was to regenerate every waypoint one by one with <code>new google.maps.LatLng()</code> but for some reason not worked even after I pushed them in array with eval().</p>
  
  <p>Changed stopover to false/true, tried different things but nothing, must be missing something.</p>