Nothing in my code has changed in the last week. But, it was working
just fine a couple days ago (I think as recently as yesterday --
though I can't be sure), but today, "address_components" is no longer
recognized. The JS error says results.address_components in the
following code is "undefined".
function calcRoute(lat,lng) {
var request = {
origin:origin,
destination:new google.maps.LatLng(lat,lng),
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
clearCookies();
clearLocations();
var myRoute = response.routes[0].legs[0];
var _zip = '';
var results = (myRoute.start_geocode);
for (n=0;n<results.address_components.length;n++) {
// does something here, but it doesn't matter
because it DIES ON THE PREVIOUS LINE
}
}
Sorry, no link. Hopefully, someone can nevertheless provide useful
feedback.
--
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.