Closed ComBatVision closed 5 years ago
Mouse pan recognizer allow to pan earth using secondary mouse button:
public class MousePanRecognizer extends PanRecognizer { @Override protected boolean shouldRecognize(MotionEvent event) { return super.shouldRecognize(event) && event.getButtonState() == MotionEvent.BUTTON_SECONDARY; } }
To use MousePanRecognizer add it to WorldWindController:
protected GestureRecognizer mouseTiltRecognizer = new MousePanRecognizer(); protected List<GestureRecognizer> allRecognizers = Arrays.asList( this.panRecognizer, this.pinchRecognizer, this.rotationRecognizer, this.tiltRecognizer, this.mouseTiltRecognizer);
and:
public void gestureStateChanged(MotionEvent event, GestureRecognizer recognizer) { if (recognizer == this.panRecognizer) { this.handlePan(recognizer); } else if (recognizer == this.pinchRecognizer) { this.handlePinch(recognizer); } else if (recognizer == this.rotationRecognizer) { this.handleRotate(recognizer); } else if (recognizer == this.tiltRecognizer || recognizer == this.mouseTiltRecognizer) { this.handleTilt(recognizer); } }
Mouse pan recognizer allow to pan earth using secondary mouse button:
To use MousePanRecognizer add it to WorldWindController:
and: