Skip to content

Instantly share code, notes, and snippets.

@mikedugan
Last active December 31, 2015 21:19
Show Gist options
  • Save mikedugan/8046055 to your computer and use it in GitHub Desktop.
Save mikedugan/8046055 to your computer and use it in GitHub Desktop.
Google GeoCode request builder
function buildApiRequest() {
var address = $('#street1').value.replace(/ /gi, '+') + ',+';
address += $('#city').value.replace(/ /gi, '+') + ',+';
return 'http://maps.googleapis.com/maps/api/geocode/json?address=' + address + $('#state').value + '&sensor=false';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment