0

I am using Google place autocomplete in my website. The user will be redirected to different pages depending on state/province of place they selected.

So my question is: how to get exact state/province of a place the user has selected?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
user3468312
  • 49
  • 1
  • 1
  • 4

1 Answers1

0

You can get lots of details using

service = new google.maps.places.PlacesService(map);
service.getDetails(request, callback);

Then inspecting the address_components should give you administrative_area_level you are looking for

See doc at: https://developers.google.com/maps/documentation/geocoding/intro?#Types for adrress components

The_Dod
  • 86
  • 1
  • 5