@@ -21,13 +21,11 @@ import android.content.Context;
|
||||
import android.opengl.GLSurfaceView;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.GestureDetector;
|
||||
|
||||
import org.oscim.android.canvas.AndroidGraphics;
|
||||
import org.oscim.android.gl.AndroidGL;
|
||||
import org.oscim.android.gl.GlConfigChooser;
|
||||
import org.oscim.android.input.AndroidMotionEvent;
|
||||
import org.oscim.android.input.GestureHandler;
|
||||
import org.oscim.backend.CanvasAdapter;
|
||||
import org.oscim.backend.GLAdapter;
|
||||
import org.oscim.map.Map;
|
||||
@@ -53,7 +51,6 @@ public class MapView extends GLSurfaceView {
|
||||
}
|
||||
|
||||
protected final AndroidMap mMap;
|
||||
protected final GestureDetector mGestureDetector;
|
||||
protected final AndroidMotionEvent mMotionEvent;
|
||||
|
||||
public MapView(Context context) {
|
||||
@@ -94,10 +91,6 @@ public class MapView extends GLSurfaceView {
|
||||
mMap.clearMap();
|
||||
mMap.updateMap(false);
|
||||
|
||||
GestureHandler gestureHandler = new GestureHandler(mMap);
|
||||
mGestureDetector = new GestureDetector(context, gestureHandler);
|
||||
mGestureDetector.setOnDoubleTapListener(gestureHandler);
|
||||
|
||||
mMotionEvent = new AndroidMotionEvent();
|
||||
}
|
||||
|
||||
@@ -116,14 +109,11 @@ public class MapView extends GLSurfaceView {
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
public boolean onTouchEvent(android.view.MotionEvent motionEvent) {
|
||||
|
||||
if (!isClickable())
|
||||
return false;
|
||||
|
||||
if (mGestureDetector.onTouchEvent(motionEvent))
|
||||
return true;
|
||||
|
||||
mMap.input.fire(null, mMotionEvent.wrap(motionEvent));
|
||||
mMotionEvent.recycle();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user