It's a strange event!
For example, I have the same problem in another function which
converts address -> coordinates
*****************************
// creo la mappa a partire da un indirizzo passato come parametro o
quello di default
function searchAddress(addr)
{
var address;
if(addr == null)
address =
document.getElementById("address").value;
else
address = addr;
var geocoder = new google.maps.Geocoder();
geocoder.geocode( {'address': address},
function(results,status)
{
if(status ==
google.maps.GeocoderStatus.OK)
{
if(addr == null)
map.setCenter(results[0].geometry.location);
else
{
userPosition =
results[0].geometry.location;
alert("userPosition = "
+userPosition);
}
}
else
{
alert("Error: " +status);
}
});
}
***************************************
In this case I put the code (to store value in a variable) in "(status
== google.maps.GeocoderStatus.OK)" but it does not works!
It seems this function was called after the rest of all the code.
Why?
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.