Hi Belk,

There are a few changes that need to be made to your code to get it to work:

provideTripAlternatives should be provideRouteAlternatives
response.trips[i].routes[0].duration.value should be
response.routes[i].legs[0].duration.value
response.trips[i].routes[0].distance.value should be r
esponse.routes[i].legs[0].distance.value

Hope this helps

- Luke


On Thu, May 6, 2010 at 12:37 AM, Belk <[email protected]> wrote:

> Hello,
>
> I'm having some troubles after the new API update. I'm confused as to
> what changes I should make to make my code work again. I get a error
> on provideTripAlternatives btw:
>
>  var request = {
>                        origin:start,
>                        destination:end,
>                        travelMode:
> google.maps.DirectionsTravelMode.DRIVING,
>                        provideTripAlternatives: true,
>                        unitSystem: google.maps.DirectionsUnitSystem.METRIC
>                };
>
>                directionsService.route(request, function(response, status)
> {
>                        if (status == google.maps.DirectionsStatus.OK) {
>                                timeArray = new Array();
>                                distanceArray = new Array();
>
>                                if (directionsService.route.length !== 0) {
>                                for (var i=0; i<=response.routes.length - 1;
> i++) {
>                                    if (i >= 0) {
>                                        timeResults =
> response.trips[i].routes[0].duration.value;
>                                        distanceResults =
> response.trips[i].routes[0].distance.value;
>                                    }
>
> Do I need to change "route" to leg or legs? Or "routes" to legs? I
> don't understand it even after I read the documentation.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to