0

has anyone an idea why this particular polyline is drawn wrong? Normally everthing works fine, but for this trip i have now ideas anymore! Test site: http://junkvibration.com/test/walk/test.htm

Thanks for help!

My waypoints of this example are:

waypoints: [{location:"Lucern",stopover:false},{location:"Paris",stopover:false},
{location:"Madrid",stopover:false},{location:"Granada",stopover:false},
{location:"Barcelona",stopover:false},{location:"Monaco",stopover:false},
{location:"Rom",stopover:false}],
optimizeWaypoints: false,
travelMode: google.maps.DirectionsTravelMode.WALKING };
Stewie Griffin
  • 14,889
  • 11
  • 39
  • 70
  • 1
    Why are you specifying WALKING directions for a 5,609 km trip? Displaying WALKING directions without the legal warning is against the terms of use. If I change to DRIVING directions, I don't get a route (ZERO_RESULTS). If I make all the waypoints {stopover:true} then it works. – geocodezip Jun 10 '13 at 00:01

1 Answers1

2

Looks like a bug in the DirectionsService to me.

If I make all the waypoints {stopover:true} then it works.

function calcRoute() {
  var request = {
    origin: "Bad Aussee",
    destination: "Rottenmann",
    waypoints: [{
      location:"Lucern",
      stopover:true
    },{
      location:"Paris",
      stopover:true
    },{
      location:"Madrid",
      stopover:true
    },{
      location:"Granada",
      stopover:true
    },{
      location:"Barcelona",
      stopover:true
    },{
      location:"Monaco",
      stopover:true
    },{
      location:"Rom",
      stopover:true
    }],
    optimizeWaypoints: false,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };

  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
    } else {
      alert("Directions request failed: "+status);
    }
  });
}

working example - stopover:true

not working (ZERO_RESULTS) - stopover:false, same request as above otherwise

example tries the same request first with stopover:false (fails), then with stopover:true (succeeds)

walking directions (UNKNOWN_ERROR with stopover:true, weird path with stopover:false)

walking directions using multiple requests to the DirectionsService - better, but seems to want me to swim from Monaco to Rome...

geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • Thanks for answer, but "stopover:true" only helps in DRIVING mode. In WALKING mode no route is shown! So, only Google can help? (This map example shows a virtual map - like Way of St. James) – user2469159 Jun 10 '13 at 19:26
  • 1
    If it is really supposed to be a walking route, then I can look that, but as I recall there was an error something to the effect of the directions were too complicated to display in the panel that you aren't displaying, but which you are required to display last I looked at the terms of us. But in any case, my take is it is a bug in the Google Maps API Directions service, someone should open an issue in the issue tracker. – geocodezip Jun 10 '13 at 19:54
  • thanks, this helped me a lot. i reported the bug in the issue tracker – vbdv Jun 12 '13 at 20:05
  • Where did you report the bug? Can you provide a link? I don't see it in the [Google Maps API issue tracker](https://code.google.com/p/gmaps-api-issues/). – geocodezip Jun 13 '13 at 13:49