2626
2727public class BasicWorldWindowController implements WorldWindowController , GestureListener {
2828
29- private static final float ZOOM_FACTOR = 1.5f ;
29+ protected float zoomFactor = 1.5f ;
3030
3131 protected final WorldWindow wwd ;
3232
@@ -84,15 +84,27 @@ public BasicWorldWindowController(WorldWindow wwd) {
8484 this .selectDragDetector = new GestureDetector (wwd .getContext (), selectDragListener );
8585 }
8686
87+ public float getZoomFactor () {
88+ return zoomFactor ;
89+ }
90+
91+ public void setZoomFactor (float zoomFactor ) {
92+ this .zoomFactor = zoomFactor ;
93+ }
94+
8795 public void setSelectDragCallback (SelectDragCallback callback ) {
8896 selectDragListener .setCallback (callback );
8997 }
9098
91- public void resetOrientation (boolean headingOnly ) {
99+ public void resetOrientation (boolean heading , boolean tilt , boolean roll ) {
92100 this .gestureDidBegin ();
93- this .lookAt .heading = 0 ;
94- if (!headingOnly ) {
101+ if (heading ) {
102+ this .lookAt .heading = 0 ;
103+ }
104+ if (tilt ) {
95105 this .lookAt .tilt = 0 ;
106+ }
107+ if (roll ) {
96108 this .lookAt .roll = 0 ;
97109 }
98110 this .wwd .cameraFromLookAt (this .lookAt );
@@ -102,7 +114,7 @@ public void resetOrientation(boolean headingOnly) {
102114
103115 public void zoomIn () {
104116 this .gestureDidBegin ();
105- this .lookAt .range /= ZOOM_FACTOR ;
117+ this .lookAt .range /= zoomFactor ;
106118 this .applyLimits (lookAt );
107119 this .wwd .cameraFromLookAt (this .lookAt );
108120 this .wwd .requestRedraw ();
@@ -111,7 +123,7 @@ public void zoomIn() {
111123
112124 public void zoomOut () {
113125 this .gestureDidBegin ();
114- this .lookAt .range *= ZOOM_FACTOR ;
126+ this .lookAt .range *= zoomFactor ;
115127 this .applyLimits (lookAt );
116128 this .wwd .cameraFromLookAt (this .lookAt );
117129 this .wwd .requestRedraw ();
0 commit comments