android - how can I make two google maps listeners? setOnCameraChangeListener -


how can create 2 listeners? 1 used clustering , other load new cluster items map if no cluster items exists on map.

       //needed clustering        map.setoncamerachangelistener(mclustermanager);         // need loading clusteritems        map.setoncamerachangelistener(new googlemap.oncamerachangelistener() {        @override        public void oncamerachange(cameraposition position) {         // ifmarkesnotinsidemapreload... 

i think it's not possible maybe solved this...

one idea set starting position , poll changes manually.. not cool :-)

i'm using googles cluster library: google cluster

i have looked clustermanager implementation of amutils library , looks calls oncamerachange on implementation of clusterrenderer if implements oncamerachangelistener. make implement interface.

relevant parts of code:

@override public void oncamerachange(cameraposition cameraposition) {     if (mrenderer instanceof googlemap.oncamerachangelistener) {         ((googlemap.oncamerachangelistener) mrenderer).oncamerachange(cameraposition);     } 

if using defaultclusterrendeder, create class like:

public class myclusterrenderer extends defaultclusterrenderer implements oncamerachangelistener { 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -