Currenty, I\'m using the following code to get the country, postal code, locality and sub-locality:
var country, postal_code, locality, sublocality; for (i =
I did it like this:
placeParser = function(place){ result = {}; for(var i = 0; i < place.address_components.length; i++){ ac = place.address_components[i]; result[ac.types[0]] = ac.long_name; } return result; };
then i just use
parsed = placeParser(place) parsed.route