您好,我想使用 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;
}
但找不到最近的地方
就像我在“美国加利福尼亚州圣地亚哥”那么我想得到类似的结果
Gaslamp/Downtown,
Pacific Beach,
Ocean Beach,
Uptown,
Hillcrest,
Mission Valley, Fashion Valley,
North Park,
但不是这个,我只得到两个值
Mission Valley East,
塞拉梅萨
所以任何人都可以帮助我我必须通过什么类型,这样我就可以获得上面的结果而不是下面的结果