Geocoding is an asynchronous call to the Google servers, so if you issue
multiple requests, you never know in what order they will return.
If you already know the addresses, then you should geocode them ahead of
time and just store the lat/lng in a database or file.

If you are showing 3 new addresses each time for some reason, then you
should change your code so that it always knows what response it's
receiving.

Here's an example in the JS API of geocoding multiple addresses:
view-source:http://gmaps-samples.googlecode.com/svn/trunk/geocoder/delayed.html

<view-source:http://gmaps-samples.googlecode.com/svn/trunk/geocoder/delayed.html>-
pamela

On Sat, Jul 18, 2009 at 3:50 AM, help(question) <[email protected]>wrote:

>
> I have several addresses that need to be converted to latlng so I can
> place markers on the map. Each address has a pieces of information
> that describe that address. What I have is 3 arrays -- one for the
> address, one for the corresponding information and one to hold the
> latlng points that are returned after the geocode success event is
> fired.
>
> What I am doing is using a for loop to go through the address array
> and geocoder.geocode(myAddresses[i]) when the geocode success event is
> fired I am pushing the response to an array I called myPoints. After
> all the addresses have been converted to latlng I use a different for
> loop to read through the myPoints array and add a marker to the map
> with the corresponding information.
>
> The problem I am having is that when I use the for loop to geocode the
> addresses my myPoints array gets load randomly. For example
> myAddress:Array = (address1, address2, address3) the new array for the
> latlng ends up being myPoints:Array = (address2, address1, address3)
> or some other random order.
>
> Does anyone know how I can do his and keep everything in order?
>
> Thank you.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" 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-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to