title: Google Maps API directionsService.route different from Google Maps Directions
body: <p>I'm using Google Maps JS API to search for nearby places, i.e. restaurants based on my LatLng :</p>
  
  <pre><code>var request = {
          location: myLocation,
          rankBy: google.maps.places.RankBy.DISTANCE,
          types: ['bar', 'cafe', 'food', 'liquor_store', 'lodging', 'meal_delivery', 'meal_takeaway', 'night_club', 'restaurant'],
          keyword: ['bar', 'pub']
      };
  searchService.nearbySearch(request, callback);
  </code></pre>
  
  <p>I get the Results Array and want to show directions to the first place from the array :</p>
  
  <pre><code>var request = {
          origin: myLocation,
          destination: bars[0].geometry.location,
          travelMode: google.maps.TravelMode.WALKING
  };
  directionsService.route(request, function (response, status) {
          if (status == google.maps.DirectionsStatus.OK) {
              directionsDisplay.setDirections(response);
              directionsDisplay.setOptions({
                  suppressMarkers: true
              });
              var myRoute = response.routes[0].legs[0];
              for (var i = 0; i &lt; myRoute.steps.length; i++) {
                  Map.marker(myRoute.steps[i].start_location, myRoute.steps[i].instructions);
              }
          } else {
              console.log("directionsService : " + status);
          }
      });
  </code></pre>
  
  <p>where <code>bars[0]</code> is the array with results from the <code>searchService.nearbySearch</code> query.</p>
  
  <p>I do get the directions, however the last "dotted leg" seems to be missing even though the pin is placed correctly. When you compare it to the maps.google.com directions there's that dotted leg between the pin and direction route. </p>
  
  <p>My API directions : <a href="http://damianbilski.com/temp/api_example.png" rel="noreferrer">http://damianbilski.com/temp/api_example.png</a></p>
  
  <p>Maps.google.com directions : <a href="http://damianbilski.com/temp/online_example.png" rel="noreferrer">http://damianbilski.com/temp/online_example.png</a></p>
  
  <p>Any idea how to get that last dotted leg with <code>directionsService.route</code>. 
  Many thanks for all your help!</p>