Google Map vs. Cluster Manager: onCameraChangeListener deprecated

I have an Android app about 500-1000 markers in size. I use the ClusterManager from android-maps-utils , as shown here , to group these markers.

In the latest update to Google Apps Services, Google Maps has changed its listener model. OnCameraChangeListenermarked as deprecated. Instead, there are four new listeners ( OnCameraIdleListener, OnCameraMoveListener, OnCameraMoveStartedListener, OnCameraMoveCanceledListener).

Since then, my application has been incredibly slow. It holds onto moving / scaling maps, the clustering process is lagging and takes a few seconds.

I thought this behavior might be due to changes in the listener model. So I tried to replace the function addOnCameraChangeListener(clustermanager)with a new one addOnCameraIdleListener(clustermanager). Unfortunately, this does not work, because it ClusterManagerdoes not implement the necessary interface.

And it gets weird because the current version (0.4.3) ClusterManageron GitHub implements this interface, so it should work.

I import ClusterManager using Gradle:

compile 'com.google.maps.android:android-maps-utils:0.4.3

but my local version ClusterManagerstill seems old, which implements the old OnCameraChangeListener.

So what is wrong here? Is this the wrong Gradle behavior? Does anyone know how to solve this problem? And is there anyone else whose Google Map / Clusterer has been slow and lagging since the last update of Utilities?

I appreciate any help. Thanks guys.

+4
1

gooleMap.setOnCameraIdleListener(mClusterManager); googleMap.setOnCameraMoveListener(mClusterManager);

ClusterManager, , ClusterManager OnCameraIdleListener.

android-maps-utils: 0.4.4 ( 'com.google.maps.android:android-maps-utils:0.4.4')

...; -)

+20

Source: https://habr.com/ru/post/1652156/


All Articles