3
votes

I am trying to get Street, City and Country with reverse geocoding using google map example https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse, But all it gives me is .formatted_address not street, city and country.

Is there any way where I can get Street, City and Country separately ?

FIDDLE

1

1 Answers

4
votes

Use .address_components instead of .formatted_address, through Address Components you can break the result into different variables and then call it into your info window. Fiddle Link