In my application I need map dragging listener, I have followed the below link: How can I handle map move end using Google Maps for Android V2? But I do not get 100% reliable solution.however its work based on the camera listener. I did the following things:
- the code works on whenever the camera zooming.
- so I changed the code to zooming level ( if zoom level is increased or decreased I do not call my methods.)
- but my function is called if not zooming level is not changed.
my need is How can I get reliable solution by using the camera listener? If any bug is raised regarding the issue on Google please share the link.
my code sample:
map.setOnCameraChangeListener(new OnCameraChangeListener() {
@Override
public void onCameraChange(CameraPosition cameraPosition) {
if(previousZoomLevel != cameraPosition.zoom) {
Log.e("zooming * previousZoomLevel", ""
+ cameraPosition.zoom + " "
+ previousZoomLevel);
}
else {
Log.e("NOT zooming * previousZoomLevel", ""
+ cameraPosition.zoom + " "
+ previousZoomLevel);
myMethod();
}
}
}