Thanks Ross K,
Everytime the value of is 3, instead of 1,2, and 3.
So being all time value 3, map shows Lake county lable only.
I am confuse when this callback function call?
I want to center of boudries.If I am writing 'geoXml.getDefaultCenter
()' this inside callback function then I am getting correct center but
if I am writing this outside callback function then I am getting null
value.
If somehow I can find center outside callback function,then my proble
will be solved.
Could you please let me know fix?
Here is code.
var county=new Array(3);
county[0]="Adams_IL";
county[1]="Cook_IL";
county[2]="Lake_IL";
for(var i=0;i<county.length;i++){
var name=county[i].split("_");
var geoXml = new GGeoXml(""http://vconsign.net/
images/"+county[i]+".kml",function() {
if (geoXml.loadedCorrectly()) {
geoXml.gotoDefaultViewport(map);
var label = new ELabel(geoXml.getDefaultCenter(),name
[0], "style1");
map.addOverlay(label); }
});
map.addOverlay(geoXml);
}
On Feb 14, 2:55 am, Rossko <[email protected]> wrote:
> > I know I am doing some wrong inside code but know know fix.It would be
> > great if some one put some focus.
>
> Look into the asynchronous behaviour of GGeoXml.
> Your for-loop fires off three GGeoXml requests and finishes.
> Some time later, one of the requests comes back and triggers the
> function.
> What is the value of 'i' at that time?
>
> 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
-~----------~----~----~----~------~----~------~--~---