Google Maps Android Clustering OnCameraChangeListener() deprecated

自古美人都是妖i 提交于 2019-12-05 08:02:35
Max Waitzman

You need to use

gooleMap.setOnCameraIdleListener(mClusterManager);

instead of

googleMap.setOnCameraMoveListener(mClusterManager);

You can to search for the source code of ClusterManager and you will see that ClusterManager implements the new OnCameraIdleListener.

Also you need to update to new android-maps-utils:0.4.4

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

Good luck and vote up... ;-)

Pravin Divraniya

It is advisable to use newly introduced four camera listeners (OnCameraIdleListener, OnCameraMoveListener, OnCameraMoveStartedListener,OnCameraMoveCanceledListener), but if you still want to go with setOnCameraChangeListener use specific version of android-maps-utils(Given below)

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

in your module level gradle file. Check this answer if you want to implement new methods.

As per the documentation, this interface has been deprecated and replaced by more granular options which you could use.

This interface was deprecated. Replaced by GoogleMap.OnCameraMoveStartedListener, GoogleMap.OnCameraMoveListener and GoogleMap.OnCameraIdleListener. The order in which the deprecated onCameraChange method will be called in relation to the methods in the new camera change listeners is undefined.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!