Route doesn't appear if the travelMode is set to BICYCLING

555 views
Skip to first unread message

samz

unread,
Dec 3, 2011, 4:07:31 PM12/3/11
to Google Maps JavaScript API v3
Hello,
In this example(*):
http://gmaps-samples-v3.googlecode.com/svn/trunk/draggable-directions/draggable-directions.html

of the Google Maps Javascript API V3 Demo Gallery:
http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/demogallery.html

the route doesn't appear if the travelMode is set to BICYCLING.

Line 47 of example source:
travelMode: google.maps.DirectionsTravelMode.DRIVING

How to display the BICYCLING route in this example?
Thanks and regards.

JKurtock

unread,
Dec 4, 2011, 12:52:43 AM12/4/11
to Google Maps JavaScript API v3
WHY doesn't it display the bicycling route? You would need to check
the "status" returned by the directionsService. In the demo, it only
checks if the status is "OK," and then displays the Directions.
Otherwise it does nothing.

So you should check what that status actually is (hint: it returns
"ZERO RESULTS"). I suspect that the mapping for Australia doesn't
include the bicycle routing that can be found in the US. (I checked in
a few places around Sydney, and always got the status "ZERO RESULTS".)

- Jeff

On Dec 3, 1:07 pm, samz <alf....@gmail.com> wrote:
> Hello,

> In this example(*):http://gmaps-samples-v3.googlecode.com/svn/trunk/draggable-directions...
>
> of the Google Maps Javascript API V3 Demo Gallery:http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/...

samz

unread,
Dec 4, 2011, 4:36:16 AM12/4/11
to google-map...@googlegroups.com
Thank you Jeff.
Yes, currently bicycle routes are only available in US.

http://code.google.com/intl/sv-SE/apis/maps/documentation/directions/#TravelModes

Travel Modes

When you calculate directions, you may specify which transportation mode to use. By default, directions are calculated as driving directions. The following travel modes are currently supported:

  • driving (default) indicates standard driving directions using the road network.
  • walking requests walking directions via pedestrian paths & sidewalks (where available).
  • bicycling requests bicycling directions via bicycle paths & preferred streets (currently only available in the US).

Thanks and regards.
Reply all
Reply to author
Forward
0 new messages