【发布时间】:2012-09-19 07:29:51
【问题描述】:
您好,我想使用 google place api 搜索最近的位置....
来自https://developers.google.com/places/documentation/supported_types 我在我的代码中使用了类型来搜索最近的地方......
下面是代码
try {
double radius = 5000; // 10000 meters
// get nearest places
nearPlaces = googlePlaces
.search(gps.getLatitude(), gps.getLongitude(), radius,
"sublocality|sublocality_level_4|sublocality_level_5|sublocality_level_3|sublocality_level_2|sublocality_level_1|neighborhood|locality|sublocality");
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
但找不到最近的地方
如果我在“San Diego, CA, USA”,那么我想得到类似的结果
煤气灯/市中心,
太平洋海滩,
海洋海滩,
住宅区,
山顶,
使命谷,
时尚谷,
北园,
但不是这个,我只得到两个像
使命谷东,
塞拉梅萨
任何人都可以帮助我我必须通过什么类型,这样我才能得到上面的结果而不是下面的结果
【问题讨论】:
标签: android google-maps google-maps-api-3 google-places-api