Created
January 15, 2017 05:50
-
-
Save jmalonzo/a6c5f0cf84c9326d8797c119297b9d64 to your computer and use it in GitHub Desktop.
Geocode custom function for Google Sheets
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
/** | |
* Geocode address using Google Maps | |
* | |
* @param address the address to geocode | |
* @return the geocoded address (possibly approximate) | |
*/ | |
function geocode(address) { | |
var response = Maps.newGeocoder().geocode(address); | |
var geom = response.results[0].geometry; | |
return geom.location.lat + ", " + geom.location.lng; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment