@Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { if (!this.isInScale && e1.getPointerCount() == 1 && e2.getPointerCount() == 1) { this.mapView.onMoveEvent(); this.mapView.getModel().mapViewPosition.moveCenter(-distanceX, -distanceY, false); return true; } return false; }
LatLong pivot = this.mapView.getMapViewProjection().fromPixels(e.getX(), e.getY()); if (pivot != null) { this.mapView.onMoveEvent(); this.mapView.onZoomEvent(); mapViewPosition.setPivot(pivot);
@Override public boolean onScaleBegin(ScaleGestureDetector detector) { if (!scaleEnabled) { return false; } this.isInScale = true; this.scaleFactorCumulative = 1f; // Quick scale (no pivot) if (this.isInDoubleTap) { this.mapView.onZoomEvent(); this.pivot = null; } else { this.mapView.onMoveEvent(); this.mapView.onZoomEvent(); this.focusX = detector.getFocusX(); this.focusY = detector.getFocusY(); this.pivot = this.mapView.getMapViewProjection().fromPixels(focusX, focusY); } return true; }