Вот код
Код: Выделить всё
var map = null;
var geocoder = null;
function load() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
geocoder = new GClientGeocoder();
showAddress("Moscow");
}
}
function showAddress(address) {
var test = null;
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
test = point;
}
}
);
}
alert(test); // !!!!!!!!!! вот тут заковыка
}