Closed GoogleCodeExporter closed 9 years ago
Original comment by neilboyd
on 26 Apr 2010 at 7:16
I've done this.
In OpenStreetMapView.java:
/**
* Zooms in at pixel centered at touchX, touchY
* @param touchX
* @param touchY
*/
public void zoomInCentered(float touchX, float touchY) {
GeoPoint center = this.getProjection().fromPixels(touchX, touchY);
setMapCenter(center);
zoomIn();
}
and then hooking up the method:
private class OpenStreetMapViewDoubleClickListener implements
GestureDetector.OnDoubleTapListener {
public boolean onDoubleTap(MotionEvent e) {
Log.i("double tap", "Double tap! " + e);
OpenStreetMapView.this.zoomInCentered(e.getX(), e.getY());
return true;
}
public boolean onDoubleTapEvent(MotionEvent e) {
return false;
}
public boolean onSingleTapConfirmed(MotionEvent e) {
return false;
}
}
in variable fields:
protected final GestureDetector.OnDoubleTapListener doubleTap = new OpenStreetMapViewDoubleClickListener();
In constructor:
this.mGestureDetector.setOnDoubleTapListener(doubleTap);
Works fine.
Original comment by nicholas...@gmail.com
on 23 Jul 2010 at 8:22
This issue was closed by revision r303.
Original comment by neilboyd
on 26 Jul 2010 at 10:56
It should really fix the point that was double-tapped, not center on it -
that's what Google Maps does. But this is good enough for a start.
Original comment by neilboyd
on 26 Jul 2010 at 10:58
Original issue reported on code.google.com by
misc2...@danielnaber.de
on 25 Apr 2010 at 12:36