i got this function:
function myfunc()
{
var x;
geo.geocode({ 'latLng': marker.getPosition() }, function (results, status) {
somestuff...
x = what i need;
});
alert(x); //x undefined...
}
The geocoding function is working properly…
How can I solve this problem??
I think the problem is that you set
xinside acallback function. You set the callback and after that you callalert(), but thecallback functionmight not have been executed at that point.