【发布时间】:2011-07-18 10:12:45
【问题描述】:
我认为一种可能的方法是:
service.search({
types: ["city"],
bounds: founded_bounds
}, function(places, status) {});
- 使用通常的Geocoder service 选择国家/州边界
- 制作place search request
但available places types 中没有“城市”类型。如何获取所选国家/州的所有城市?
UPD 感谢 bweaver,地点 城市
但现在我遇到了另一个麻烦: 谷歌地图地方搜索工作真的很荒谬!我做了一点demo 来显示问题。我也会将它发布到 google api bugtracker。
*see console F12
Search for places in Hawaii (all types): 21
Search for places in Honolulu (all types): 22
这是不真实的。
【问题讨论】:
-
(administrative_area_level_1 == state) 和 (locality == city) 如果我没记错的话。
标签: javascript google-maps google-maps-api-3