> Could you please let me know fix?

No, but I'll tell you what's wrong.
If you want detailed help, you'll need to post a link and stop posting
code.

>            for(var i=0;i<county.length;i++){
> ...
>                             var geoXml = new 
> GGeoXml("http://mysitename/"+county[i]
+".kml", function() {
> ...

This is asynchronous, many people new to GMaps API struggle with the
idea.
See -
   http://econym.org.uk/gmap/async.htm

Your loop fires off a GGeoXml request to Google's servers.
The responses to these take ages to come back, and the javascript
execution does NOT stop and wait for any response.
So your loop runs around again, and fires off the next GGeoXml
request, and so on.

Your loop goes round three times and finishes, and execution carries
on with whatever comes after the loop.
Some time later, a response might come back from Google.  It might not
even be the first one that was sent.
At that time, it's callback function is triggered and uses whatever
data is set at this time.
For example, as your loop long ago finished, 'i' will have been left
at 3 and nothing else will change that.
For your three GGeoXml requests, each one will run its callback
function with 'i' set to 3.

cheers, Ross K

--~--~---------~--~----~------------~-------~--~----~
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