Google offers a service where you can enter the address, and it will return the latitude and longitude (as well as other information). The way to use this google service is to call a url that returns a JSON. The google URL to call is this: http://maps.googleapis.com/maps/api/geocode/output?parameters
I am trying to make the output of that go into a JSON that I can navigate through and select my desired variables.
Here is my code:
address_name = "1600 Amphitheatre Parkway, Mountain View, CA";
address_name = address_name.replace(/ /gi,'+');
var geocode = "http://maps.googleapis.com/maps/api/geocode/json?address="+address_name+"&sensor=true";
//alert(geocode)
var json = get_content_from(geocode)
I have tried to use .load() but either I'm doing something completely wrong or it just does not work. Is there a way to load this into a variable called json?
Sorry if this is trivial, I have tried searching but I'm not really sure what the keywords would be in this case so I've come up with nothing.
Thanks, Sam