Hello,
I am newbie android developers. I am developing an application in which i am using google maps. I have to implement double tap zoom in google maps. When i double click on a map the map should zoom in. Kindly if it is possible provide a sample code. I have written a code but i dont know what to add more.
public class Maps extends MapActivity implements OnGestureListener, OnDoubleTapListener{
private GestureDetector detector;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//MapViewer mapViewer = new MapViewer(null, null);
MapView mapView = (MapView) findViewById(R.id.mapview);
detector = new GestureDetector(this,this);
mapView.setBuiltInZoomControls(true);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
public boolean onDoubleTap(MotionEvent e) {
// TODO Auto-generated method stub
return false;
}
public boolean onDoubleTapEvent(MotionEvent e) {
// TODO Auto-generated method stub
return false;
}
public boolean onSingleTapConfirmed(MotionEvent e) {
// TODO Auto-generated method stub
return false;
}
public boolean onDown(MotionEvent e) {
// TODO Auto-generated method stub
return false;
}
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
// TODO Auto-generated method stub
return false;
}
public void onLongPress(MotionEvent e) {
// TODO Auto-generated method stub
}
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
float distanceY) {
// TODO Auto-generated method stub
return false;
}
public void onShowPress(MotionEvent e) {
// TODO Auto-generated method stub
}
public boolean onSingleTapUp(MotionEvent e) {
// TODO Auto-generated method stub
return false;
} }