Danish Adeel
Danish Adeel

Reputation: 730

Get street name with Reverse Geocoding

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

Upvotes: 3

Views: 1344

Answers (1)

JunaidFarooqui
JunaidFarooqui

Reputation: 460

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

Upvotes: 4

Related Questions