Created
December 27, 2013 01:25
-
-
Save gr33ndata/8141155 to your computer and use it in GitHub Desktop.
This script adds a latlng() function to your Google Spreadsheets so you can easily convert addresses into latitudes and longitudes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function latlng(address){ | |
var response = Maps.newGeocoder().geocode(address); | |
if (response.status == "OK"){ | |
var result = response.results[0]; | |
return '' + result.geometry.location.lat + ',' + result.geometry.location.lat + ''; | |
} | |
else{ | |
return '0,0'; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment