Hi All,
I've been struggling with this for a few hours now.
Basically i have an array of information about a location that i want
attach to the marker once it is created (eg, marker title, info window
content to open onclick)
Because getLatLng is Asynchronous the results often come back in a
different order and i can see no way to relate the Array entries to
the point returned when creating the marker.
The only solution i can see is to use getLocations and somehow loosely
match the formatted address to my requested address... but it seems
like there should be a better way...
simplified example code:- (does not work because the addresses often
come back in a different order)
geocoder.getLatLng(address, function(point) {
curMarkerCount++;
name = locationDetails[curMarkerCount].name;
if(!point){
//name and address are often mismatched below
alert('Address for '+name+' could not be located\n'+address);
}
else{
var marker=new GMarker(markerLocation,
{title:locationDetails[curMarkerCount].title});
}
});
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---