Var*_*ian 5 android google-maps
可能重复:
双击 - >放大Android MapView?
我有一个Activity延伸MapActivity.我使用谷歌地图.
我需要通过双击或双击来放大.
有人可以帮我弄这个吗?
我已经看过下面的内容,但它们并不是我想要的.
我意识到onTouchListener这只被召唤一次,为什么会这样?
// set Gesture
detector = new GestureDetector(new GestureReactor());
mapView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
System.out.println("Inside onTouch");
return detector.onTouchEvent(event);
}
});
Run Code Online (Sandbox Code Playgroud)
我有私人课程:
private class GestureReactor extends SimpleOnGestureListener {
@Override
public boolean onDoubleTap(MotionEvent e) {
System.out.println("inside onDouble");
controller.zoomInFixing((int) e.getX(), (int) e.getY());
return super.onDoubleTap(e);
}
}
Run Code Online (Sandbox Code Playgroud)
和
private GestureDetector detector;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11280 次 |
| 最近记录: |