function getLongLat(address)
{
geocoder = new GClientGeocoder();
if (geocoder) {
geocoder.getLatLng(address,
function(point) {
if (!point) {
return "null";
} else {
return point;
}
}
);
}
}
如果我输入 alert(point) ,我会得到经度和纬度。
最佳答案
试试这个:D
function getLongLat(address)
{
geocoder = new GClientGeocoder();
if (geocoder) {
return geocoder.getLatLng(address,
function(point) {
if (!point) {
return "null";
} else {
return point;
}
}
);
}
return false;
}
关于javascript - 为什么这个函数总是返回 'undefined',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/920206/