如何在PlaceDetectionClient中由健身房,医院实施场所过滤器
Task<PlaceLikelihoodBufferResponse> placeResult = mPlaceDetectionClient.getCurrentPlace(null);
placeResult.addOnCompleteListener(new OnCompleteListener<PlaceLikelihoodBufferResponse>() {
@Override
public void onComplete(@NonNull Task<PlaceLikelihoodBufferResponse> task) {
Log.d(TAG, "current location places info");
List<Place> placesList = new ArrayList();
PlaceLikelihoodBufferResponse likelyPlaces = task.getResult();
for (PlaceLikelihood placeLikelihood : likelyPlaces) {
placesList.add(placeLikelihood.getPlace().freeze());
}
likelyPlaces.release(); }}
答案 0 :(得分:0)
您想要的“附近搜索”功能似乎不在Android SDK中。
Google Maps Place Search API拥有您想要的东西:
https://maps.googleapis.com/maps/api/place/nearbysearch/json
?key=api-key
&location=latitude,longitude
&radius=meters
&rankby=prominence|distance
注意此警告:
默认情况下,当用户选择一个地点时,“附近搜索”会返回所选地点的所有可用数据字段,您将成为billed accordingly。无法将“附近的搜索”请求限制为仅返回特定字段。为了避免请求(和支付)您不需要的数据,请改用“查找位置”请求。