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?
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?
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