Android 용 Places.GeoDataApi를 사용 중이며 요청을 수행하는 기기의 위치에 따라 검색 결과가 달라집니다. 결과가 일관되게 경계 안에 있어야합니다. 그게 getAutocompletePredictions 요청에 셋업 될 수 있는지는 모르겠다. 내가 누락 된 것이 있습니까?범위 내에서만 Places.GeoDataApi.getAutocompletePredictions을 가져 오는 방법은 무엇입니까?
나는 통해 GoogleApiClient 및 장소 API를 사용하여 주소/장소 자동 완성 추천 수 :
Places.GeoDataApi.getAutocompletePredictions()
이 방법은 GoogleApiClient 개체, 자동으로 완성 할 수있는 문자열을 요구를하고, 위도 경도 경계는 검색 범위를 제한하는 객체. 이것은 내 사용이 모습입니다 같은 : 사용
LatLngBounds bounds = new LatLngBounds(new LatLng(38.46572222050097, -107.75668023304138),new LatLng(39.913037779499035, -105.88929176695862));
GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.addApi(Places.GEO_DATA_API)
.build();
PendingResult<AutocompletePredictionBuffer> results =
Places.GeoDataApi.getAutocompletePredictions(googleApiClient, "Starbucks", bounds, null);
버전 : com.google.android.gms : 플레이 서비스 - 위치 : 8.3.0
문서 : https://developers.google.com/places/android/autocomplete
:이 답변에 설명 된대로 https://developers.google.com/places/web-service/search?hl=fr
그런 다음, 매개 변수 경계를 설정하고, 장소를 JSON 응답에서 내부의 경계를 얻을 수 있어야합니다 사례가 열렸습니다. https://code.google.com/p/gmaps-api-issues/issues/detail?id=10981&thanks=10981&ts=1480591333 –