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].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to