Skip to content

Instantly share code, notes, and snippets.

View DanLiebeschutz's full-sized avatar

DanLiebeschutz

View GitHub Profile
@DanLiebeschutz
DanLiebeschutz / Latitude and longitude values for given address.txt
Last active May 12, 2020 14:33
Google apps script custom function that returns latitude and longitude values for given address using the Google Maps Geocoder.
function GEOCODE_GOOGLE(address) {
if (address!=""){
if (address.map) {
return address.map(GEOCODE_GOOGLE)
}
else {
var r = Maps.newGeocoder().geocode(address)
for (var i = 0; i < r.results.length; i++) {
var res = r.results[i]
return res.geometry.location.lat + ", " + res.geometry.location.lng