Hi guys,
I have a problem with the asynchronous aspect of the GClientGeocoder.
I have an object inlcuding optional geo coordinates and an address for
the case that no geo coordinates exist to resolve them. I'm using the
following code:
function someFunction(lat, lng, address) {
var pin = new Pin();
if (lat && lng) {
//if having lat and lng there is no problem
pin.setLatLng(new google.maps.LatLng(lat,lng));
} else {
//lat and lgn has to be resolved
var clientGeocoder = new google.maps.ClientGeocoder();
clientGeocoder.getLatLng(address, function(latLng) {
pin.latLng = latLng;
});
}
return pin;
}
Now the problem is, that he callback function does not know the pin
object and is does not get the geo coordinates. The object may not
have the coordinate while returning but at some time it shall get
them.
Does anyone has a solution?
Thanks
--
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.