On line 135 you are calling onGDirectionsLoad with dirResult, but that method expects a DirectionsRequest object for use on line 265 to call DirectionsService.route.
Chad Killingsworth On Oct 4, 6:51 am, Donaldini <[email protected]> wrote: > I've put the code in a check to see whether it was indeed zero and you > were right. > But unfortunatly I get another error. > > However this time it's an error in the main.js, which is Google's not > mine. So I must be calling something wrong. > The error on the page says it's a problem with the <status> property. > After some checking online I couldn't really find anything other that > people using the exact same code. > > http://www.donaldini.be/files/test/ > > Thanks again! > > On 29 sep, 17:32, "[email protected]" <[email protected]> wrote: > > > > > > > > > On Sep 29, 7:15 am, Donaldini <[email protected]> wrote: > > > > Ah k, I wasn't sure how to interpret the "extends MVCarray" in the > > > docs. > > > > However, the errors keep on coming :-) > > > > --> Uncaught TypeError: Cannot call method 'toUrlValue' of undefined > > > in this file:http://www.donaldini.be/files/test/ > > > The problem is not toUrlValue, but that the getAt(0) isn't valid. You > > need to check that the array has at least one member. > > > This looks like an problem with the sequencing in your code. The > > directions request is asynchronous, you can't use the polyline until > > the callback function has run (you should do any processing of it > > inside the callback function). > > > -- Larry > > > > Is this another difference error in the V2 and V3? Cause I didn't > > > change the original code? > > > Sorry to be asking all this, but it's because i'm not that familiar > > > with all of this. > > > > On 29 sep, 13:28, Rossko <[email protected]> wrote: > > > > > > --> Uncaught TypeError: Object #<a X> has no method 'getLength' > > > > > in this file:http://www.donaldini.be/files/test/ > > > > > It's right, polyline has no getLength() method > > > > polyline.getLength() > > > > The path of a polyline is an MVCarray, get hold of that and do the > > > > getLength on > > > > that.http://code.google.com/apis/maps/documentation/javascript/reference.h... > > > > polyline.getPath().getLength()- Hide quoted text - > > > > - Show quoted text - -- 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.
