Thank you for all your replies. I really appreciate them :). For those who requested that I make the file publicly available I have done so here http://aspspider.net/DarkStorm490/ . Click on the 'Change2' button to execute the calcDistance function.
On Oct 20, 1:05 am, Rossko <[email protected]> wrote: > You should abandon the use of document.write > When that's used _after_ the webpage has been rendered, it generally > destroys the webpage. The document.write lines are only in there at the moment because I wanted to see the values. Once I am happy that the function works correctly I will remove them. Thanks for the suggestion, I do notice that they essentially destroy the webpage. > Getting directions takes time from the remote service, so not only do > you need to use the results only after they have become available > (i.e. in the callback) - you don't want to be doing document.writes > at that time either. I believe I am storing the results in the callback? cpDist[i] is set to the distance of the trip within the callback function. I have modified the code slightly since my original post. The link will be using this slightly modified code. Thanks for your help thus far, I will continue trying to play around and find the solution! :) ~ Daniel -- 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.
