0

장소 선택 도구가 시작되면 근처 장소 목록이 표시 될 옆에 3-5 초 길이의 로딩 서클 애니메이션이 있습니다. 적재 원이 사라지면 목록에 주변 장소가 표시되지 않고 근처에 장소 핀이 표시되지 않습니다.Android Google Place Picker :지도 팬까지 인접한 장소가 없습니다.

이제는 어느 방향 으로든지도를 이동 (확대/축소는 아무 것도하지 않음)하면 상당한 양의 인근 장소가 잘로드됩니다.

아래의 첫 번째 이미지는 장소 선택기가 실행 된 후 찍은 것입니다.지도가 표시 될 때까지 주변 장소를로드하지 않고이 방법으로 계속 표시됩니다.

두 번째 이미지는 주변 장소가 올바르게로드 된지도를 패닝 한 다음 촬영 한 것입니다.

하단에 관련 코드가 있습니다. 더 필요한 경우 알려주세요.

Before panning the map After panning the map

<manifest 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> 
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> 
    <application 
     <meta-data 
      android:name="com.google.android.geo.API_KEY" 
      android:value="MY_API_KEY" /> 
     <meta-data 
      android:name="com.google.android.gms.version" 
      android:value="@integer/google_play_services_version" /> 
    </application> 
</manifest> 

// Emulator is using google play services version 9.4.52 
dependencies {  
    compile 'com.google.android.gms:play-services-maps:9.4+' 
    compile 'com.google.android.gms:play-services-places:9.4+' 
    compile 'com.google.android.gms:play-services-location:9.4+' 
} 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    mGoogleApiClient = new GoogleApiClient 
      .Builder(this) 
      .addApi(Places.GEO_DATA_API) 
      .addApi(Places.PLACE_DETECTION_API) 
      .enableAutoManage(this, this) 
      .build(); 
} 

public void choosePlace() { 
    try { 
     PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder(); 
     Intent intent = intentBuilder.build(this); 
     startActivityForResult(intent, PLACE_PICKER_REQUEST); 
    } catch (GooglePlayServicesRepairableException e) { 
     // This is not being thrown 
    } catch (GooglePlayServicesNotAvailableException e) { 
     // This is not being thrown 
    } 
} 

@Override 
public void onConnectionFailed(ConnectionResult result) { 
    // This is not being called 
} 
+0

? 즉, 현재 위치에 대한 결과를 제공하지 않습니까? 아니면 처음에만 실패합니까? – AndrewR

+0

TL; DR : 지도가 현재 위치 주변에 있거나 아주 가까이에있을 때 근처 장소를로드하지 않습니다. 나는이 동작을 기대하지는 않았지만 여기에 있습니다 : 현재 위치에서 패닝하면, 나는 팬 위치를 얻습니다. 내 위치로 돌아 가거나 아주 가까이에 위치하면 현재 위치 주변에 어떤 위치도로드되지 않습니다. 또한 내가 떨어져서 내 위치로 돌아가려면 팹을 사용하면 아무 위치도로드되지 않습니다. 이 설명을 요청 해 주셔서 감사합니다. – user1968412

답변

0

당신이 추가 했습니까? 나는에 메타 데이터를 추가하는 것을 잊었다 때문에

<meta-data    
    android:name="com.google.android.geo.API_KEY" 
    android:value="your_key" /> 

내가 같은 문제를 가지고 내 매니페스트

멀리지도를 패닝 후 현재 위치로 다시 이동하면 어떻게됩니까
+0

예 그게 추가되었습니다. – user1968412