0

我在我的网站中使用 Google 地方自动完成功能。根据他们选择的州/省,用户将被重定向到不同的页面。

所以我的问题是:如何获得用户选择的地点的确切州/省?

4

1 回答 1

0

你可以得到很多细节使用

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

然后检查address_components应该给你administrative_area_level你正在寻找

请参阅文档: https ://developers.google.com/maps/documentation/geocoding/intro? #Types 以获取地址组件

于 2018-05-27T08:19:13.033 回答