2

As title, I encountered following build error when set mClusterManager as the listener by OnCameraIdleList

SetOnCameraIdleListener (com.google.android.gms.maps.GoogleMap.OnCameraIdleListener) in GoogleMap cannot be applied to (com.google.maps.android.clustering.ClusterManager<gcm.play.android.samples.com.gcmquickstart.model.MyItem>)

My OnMapReady method is shown as below.

@Override
public void onMapReady(GoogleMap googleMap) {
    mMap = googleMap;

    mMap.clear();

    mMap.setOnMarkerClickListener(this);
    mMap.setOnMapClickListener(this);
    mMap.setInfoWindowAdapter(new MyInfoWindowAdapter());

    mMap.moveCamera(CameraUpdateFactory.newLatLng(currPoint));
    mMap.moveCamera(CameraUpdateFactory.zoomTo(currentZoom));
    mClusterManager = new ClusterManager<MyItem>(this, mMap);
    mMap.setOnCameraIdleListener(mClusterManager);


}

If cast mClusterManager to (GoogleMap.OnCameraIdleListener), it may build successfully but would encounter a runtime exception later. Is there any setting or configuration needs to be corrected? Thanks.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Ray
  • 21
  • 2
  • Thanks for sharing this question, as i am facing same issue. – Ronak Joshi Aug 10 '16 at 13:35
  • I tried a work-around solution which is to import library source code into my project and it worked. You may refer to the link below. http://stackoverflow.com/questions/34380497/adding-library-source-into-android-studio. Still looking forward to the correct solution. Thanks. – Ray Aug 12 '16 at 15:28

0 Answers0