Thanks for your reply. I see now why that's causing the problem. I'll
have a closer look at your example to try and figure out how to
implement using just the one object. As I said I'm very new to
javascript so it could take some time. I am used to the php
interpreter giving me explicit errors so in javascript I get lost
quite easily.

I am writing this application as I go along and it's final purpose
will be to show the routes on the map. But not all of them however, if
this violates the TOS I shall have to explore another means of
achieving my goal.

The idea of the application is to take n number of locations and
calculate the closest location for all given employees to travel to,
then show this location and the routes from all other locations on the
map. If you have any suggestions as to how I can do this more
efficiently I would be very appreciative.

Again many thanks for helping me out.

Andy

On Nov 22, 4:09 am, marcelo <[EMAIL PROTECTED]> wrote:
> There are several problems, and it is not the speed that causes it to
> fail.
>
> 1. You're executing the javascript before any of the divs have been
> created, so getElementById() returns null
> 2. When the first GDirections object completes and it calls the
> callback function, and in that function you try to read from all
> GDirections objects, most of which have not yet completed, so the
> first dirnX.getDistance() is OK, but all other dirnY.getDistance() are
> undefined. (Look at the firefox error console)
>
> Look at this example to see how to send multiple directions requests
> with only one GDirections object:http://maps.forum.nu/gm_driving_radius.html
>
> And forget about writing it with PHP. This is client side only, so PHP
> cannot be a great help here.
>
> Also, keep in mind that the Google Maps API TOS only allows you to use
> this data if you're going to display it on a map. From your page, it
> looks as if you only intend to get the distances to store in your
> database, and use elsewhere.
>
> --
> Marcelo -http://maps.forum.nu
> --
>
> On Nov 22, 1:00 am, "A.Iszatt" <[EMAIL PROTECTED]> wrote:
>
> > Hi guy's, I'm incredibly new to Google Maps API, and Javascript for
> > that matter so treat me gently!
>
> > I've been working on a prototype application, ultimately to be
> > incorporated into something more meaningful.
>
> > I am taking a MySQL database populated with employee names and their
> > home locations. These locations are stored as both coords and normal
> > addresses. I use the coords to plot their locations on the map and
> > their addresses to calculate the driving distances between them.
>
> > Now here is my problem. In any given scenario there will be up to 11
> > employee locations needing to have their driving distances to every
> > other location calculated. Now if there are 11 locations (worst case
> > scenario), then I calculate (hopefully correctly) that there will be
> > 55 separate driving distances to be found. My problem occurs when I
> > try and achieve this, I am assuming that there is a limit to how many
> > requests you can make in a certain time, because I only receive around
> > 10-15 results back? If this is the case then I ask how can I slow down
> > the process?
>
> > Here is a link to the page I am referring 
> > to:http://phillipshost.co.uk/test/mapwithdistances.php
>
> > The page is generated dynamically from the database using php which is
> > why some of the script may look slightly informal. I haven't had
> > chance to format it correctly yet.
>
> > So I'm either looking for help on what I've implemented incorrectly,
> > or how to slow down the fetching process so I don't request too much
> > from the servers at once.
>
> > I would also like to know if it is possible to use php to retrieve
> > these driving distances? And if not can I use javascript to write my
> > results to a txt file?
>
> > Thanks for any help you could provide, it would be much appreciated.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to