-1

maprecyclerView으로 변경하고 싶습니다. 그러나 onScrollStateChanged 메서드를 사용하고 내 LatLng을 설정하면 마커를 바꿀 수없고 카메라를 움직일 수 없습니다!마커 변경 방법은 recyclerView

이제 마커를 변경하는 방법으로 RecyclerView을 스크롤 하시겠습니까?

그리고 이것을 수행하는 가장 좋은 방법은 무엇입니까?

감사합니다.

답변

0

마커를 설정하고 카메라를 움직이는 코드는 다음과 같아야합니다. 도움이 되었기를 바랍니다.

private void setLocationToMap(LatLng latLng) { 
     if (googleMap != null) { 
      MarkerOptions myLocation = new MarkerOptions(); 
      myLocation.position(latLng); 
      googleMap.clear(); 
      googleMap.addMarker(myLocation); 
      googleMap.animateCamera(CameraUpdateFactory.newLatLng(latLng)); 
      myMarker = latLng; 
     } 
    }