function getLatLong(adress) {
try{
if(adress=="")return("");
var geo = Maps.newGeocoder().geocode(adress);
if(geo.status=="OK"){
var lng = geo.results[0].geometry.viewport.southwest.lng;
var lat = geo.results[0].geometry.viewport.southwest.lat;
return([lat,lng]);
}
else{
return("error");
}
}
catch(err){
return(err);
}
}
A | B | C
1 Taipei | =TRANSPOSE(getLatLong(A1)) | 2
3
References :
How to get Latitude and Longitude for Addresses?
沒有留言:
張貼留言