diff --git a/worldwind-examples/src/main/AndroidManifest.xml b/worldwind-examples/src/main/AndroidManifest.xml
index 7db09c69f..c37ad91f4 100644
--- a/worldwind-examples/src/main/AndroidManifest.xml
+++ b/worldwind-examples/src/main/AndroidManifest.xml
@@ -56,6 +56,14 @@
android:noHistory="true"
android:theme="@style/AppTheme.NoActionBar">
+
+
50) {
-
- // Get the current navigator state to apply to the overlays
- event.getNavigator().getAsLookAt(wwd.getGlobe(), lookAt);
- event.getNavigator().getAsCamera(wwd.getGlobe(), camera);
+ // Get the current camera state to apply to the overlays
+ wwd.cameraAsLookAt(lookAt);
// Update the overlays
- updateOverlayContents(lookAt, camera);
+ updateOverlayContents(lookAt, event.getCamera());
updateOverlayColor(eventAction);
lastEventTime = currentTime;
@@ -127,15 +128,16 @@ protected void fadeCrosshairs() {
}
/**
- * Displays navigator state information in the status overlay views.
+ * Displays camera state information in the status overlay views.
*
- * @param lookAt Where the navigator is looking
+ * @param lookAt Where the camera is looking
* @param camera Where the camera is positioned
*/
protected void updateOverlayContents(LookAt lookAt, Camera camera) {
- latView.setText(formatLatitude(lookAt.latitude));
- lonView.setText(formatLongitude(lookAt.longitude));
- altView.setText(formatAltitude(camera.altitude));
+ latView.setText(formatLatitude(lookAt.position.latitude));
+ lonView.setText(formatLongitude(lookAt.position.longitude));
+ elevView.setText(formatElevaton(wwd.getGlobe().getElevationAtLocation(lookAt.position.latitude, lookAt.position.longitude)));
+ altView.setText(formatAltitude(camera.position.altitude));
}
/**
@@ -147,6 +149,7 @@ protected void updateOverlayColor(@WorldWind.NavigatorAction int eventAction) {
int color = (eventAction == WorldWind.NAVIGATOR_STOPPED) ? 0xA0FFFF00 /*semi-transparent yellow*/ : Color.YELLOW;
latView.setTextColor(color);
lonView.setTextColor(color);
+ elevView.setTextColor(color);
altView.setTextColor(color);
}
@@ -160,6 +163,12 @@ protected String formatLongitude(double longitude) {
return String.format("%7.3f°%s", (longitude * sign), (sign >= 0.0 ? "E" : "W"));
}
+ protected String formatElevaton(double elevation) {
+ return String.format("Alt: %,.0f %s",
+ (elevation < 100000 ? elevation : elevation / 1000),
+ (elevation < 100000 ? "m" : "km"));
+ }
+
protected String formatAltitude(double altitude) {
return String.format("Eye: %,.0f %s",
(altitude < 100000 ? altitude : altitude / 1000),
diff --git a/worldwind-examples/src/main/java/gov/nasa/worldwindx/MGRSGraticuleActivity.java b/worldwind-examples/src/main/java/gov/nasa/worldwindx/MGRSGraticuleActivity.java
new file mode 100644
index 000000000..4b1c597ec
--- /dev/null
+++ b/worldwind-examples/src/main/java/gov/nasa/worldwindx/MGRSGraticuleActivity.java
@@ -0,0 +1,16 @@
+package gov.nasa.worldwindx;
+
+import android.os.Bundle;
+
+import gov.nasa.worldwind.layer.graticule.MGRSGraticuleLayer;
+
+public class MGRSGraticuleActivity extends GeneralGlobeActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ this.wwd.getLayers().addLayer(new MGRSGraticuleLayer());
+ }
+
+}
diff --git a/worldwind-examples/src/main/java/gov/nasa/worldwindx/OmnidirectionalSightlineActivity.java b/worldwind-examples/src/main/java/gov/nasa/worldwindx/OmnidirectionalSightlineActivity.java
index b6cb82afb..88acc4de5 100644
--- a/worldwind-examples/src/main/java/gov/nasa/worldwindx/OmnidirectionalSightlineActivity.java
+++ b/worldwind-examples/src/main/java/gov/nasa/worldwindx/OmnidirectionalSightlineActivity.java
@@ -14,6 +14,7 @@
import gov.nasa.worldwind.PickedObject;
import gov.nasa.worldwind.PickedObjectList;
import gov.nasa.worldwind.WorldWind;
+import gov.nasa.worldwind.WorldWindow;
import gov.nasa.worldwind.geom.Line;
import gov.nasa.worldwind.geom.LookAt;
import gov.nasa.worldwind.geom.Position;
@@ -83,12 +84,12 @@ protected void onCreate(Bundle savedInstanceState) {
this.wwd.getLayers().addLayer(sightlineLayer);
// Override the WorldWindow's built-in navigation behavior with conditional dragging support.
- this.controller = new SimpleSelectDragNavigateController();
+ this.controller = new SimpleSelectDragNavigateController(this.wwd);
this.wwd.setWorldWindowController(this.controller);
// And finally, for this demo, position the viewer to look at the sightline position
LookAt lookAt = new LookAt().set(pos.latitude, pos.longitude, pos.altitude, WorldWind.ABSOLUTE, 2e4 /*range*/, 0 /*heading*/, 45 /*tilt*/, 0 /*roll*/);
- this.getWorldWindow().getNavigator().setAsLookAt(this.getWorldWindow().getGlobe(), lookAt);
+ this.getWorldWindow().cameraFromLookAt(lookAt);
}
/**
@@ -133,6 +134,10 @@ public boolean onScroll(MotionEvent downEvent, MotionEvent moveEvent, float dist
}
});
+ public SimpleSelectDragNavigateController(WorldWindow wwd) {
+ super(wwd);
+ }
+
/**
* Delegates events to the select/drag handlers or the native World Wind navigation handlers.
*/
diff --git a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PathsPolygonsLabelsActivity.java b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PathsPolygonsLabelsActivity.java
index 33d94bd34..91778bec3 100644
--- a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PathsPolygonsLabelsActivity.java
+++ b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PathsPolygonsLabelsActivity.java
@@ -27,6 +27,7 @@
import gov.nasa.worldwind.BasicWorldWindowController;
import gov.nasa.worldwind.PickedObjectList;
import gov.nasa.worldwind.WorldWind;
+import gov.nasa.worldwind.WorldWindow;
import gov.nasa.worldwind.geom.Offset;
import gov.nasa.worldwind.geom.Position;
import gov.nasa.worldwind.layer.RenderableLayer;
@@ -69,9 +70,12 @@ protected void onCreate(Bundle savedInstanceState) {
FrameLayout globeLayout = (FrameLayout) findViewById(R.id.globe);
globeLayout.addView(this.statusText);
+ // Get a reference to the WorldWindow view
+ WorldWindow wwd = this.getWorldWindow();
+
// Override the WorldWindow's built-in navigation behavior by adding picking support.
- this.getWorldWindow().setWorldWindowController(new PickController());
- this.getWorldWindow().getLayers().addLayer(this.shapesLayer);
+ wwd.setWorldWindowController(new PickController(wwd));
+ wwd.getLayers().addLayer(this.shapesLayer);
// Load the shapes into the renderable layer
statusText.setText("Loading countries....");
@@ -352,6 +356,10 @@ public boolean onSingleTapUp(MotionEvent event) {
}
});
+ public PickController(WorldWindow wwd) {
+ super(wwd);
+ }
+
/**
* Delegates events to the pick handler or the native WorldWind navigation handlers.
*/
diff --git a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksDemoActivity.java b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksDemoActivity.java
index 8b7100fb6..99ca79f8e 100644
--- a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksDemoActivity.java
+++ b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksDemoActivity.java
@@ -30,6 +30,7 @@
import gov.nasa.worldwind.BasicWorldWindowController;
import gov.nasa.worldwind.PickedObject;
import gov.nasa.worldwind.PickedObjectList;
+import gov.nasa.worldwind.WorldWindow;
import gov.nasa.worldwind.geom.Position;
import gov.nasa.worldwind.layer.RenderableLayer;
import gov.nasa.worldwind.render.ImageSource;
@@ -64,8 +65,11 @@ protected void onCreate(Bundle savedInstanceState) {
FrameLayout globeLayout = (FrameLayout) findViewById(R.id.globe);
globeLayout.addView(this.statusText);
+ // Get a reference to the WorldWindow view
+ WorldWindow wwd = this.getWorldWindow();
+
// Override the WorldWindow's built-in navigation behavior by adding picking support.
- this.getWorldWindow().setWorldWindowController(new PickController());
+ wwd.setWorldWindowController(new PickController(wwd));
new CreatePlacesTask().execute();
}
@@ -402,6 +406,10 @@ public boolean onSingleTapUp(MotionEvent e) {
}
});
+ public PickController(WorldWindow wwd) {
+ super(wwd);
+ }
+
/**
* Delegates events to the pick handler or the native WorldWind navigation handlers.
*/
diff --git a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksMilStd2525Activity.java b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksMilStd2525Activity.java
index 7476bc4db..7d8decc23 100644
--- a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksMilStd2525Activity.java
+++ b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksMilStd2525Activity.java
@@ -39,7 +39,7 @@ protected void onCreate(Bundle savedInstanceState) {
Position pos = new Position(32.4520, 63.44553, 0);
LookAt lookAt = new LookAt().set(pos.latitude, pos.longitude, pos.altitude, WorldWind.ABSOLUTE,
1e5 /*range*/, 0 /*heading*/, 45 /*tilt*/, 0 /*roll*/);
- this.getWorldWindow().getNavigator().setAsLookAt(this.getWorldWindow().getGlobe(), lookAt);
+ this.getWorldWindow().cameraFromLookAt(lookAt);
// The MIL-STD-2525 rendering library takes time initialize, we'll perform this task via the
// AsyncTask's background thread and then load the symbols in its post execute handler.
diff --git a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksMilStd2525StressActivity.java b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksMilStd2525StressActivity.java
index 86db77965..f3c59f248 100644
--- a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksMilStd2525StressActivity.java
+++ b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksMilStd2525StressActivity.java
@@ -19,7 +19,7 @@
import armyc2.c2sd.renderer.utilities.MilStdAttributes;
import armyc2.c2sd.renderer.utilities.ModifiersUnits;
-import gov.nasa.worldwind.Navigator;
+import gov.nasa.worldwind.geom.Camera;
import gov.nasa.worldwind.geom.Position;
import gov.nasa.worldwind.layer.RenderableLayer;
import gov.nasa.worldwind.layer.ShowTessellationLayer;
@@ -1419,9 +1419,9 @@ public void doFrame(long frameTimeNanos) {
double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9;
double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond);
- // Move the navigator to simulate the Earth's rotation about its axis.
- Navigator navigator = getWorldWindow().getNavigator();
- navigator.setLongitude(navigator.getLongitude() - cameraDegrees);
+ // Move the camera to simulate the Earth's rotation about its axis.
+ Camera camera = getWorldWindow().getCamera();
+ camera.position.longitude -= cameraDegrees;
// Redraw the WorldWindow to display the above changes.
this.getWorldWindow().requestRedraw();
diff --git a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksSelectDragActivity.java b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksSelectDragActivity.java
index a51e611f7..4d86ca7dd 100644
--- a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksSelectDragActivity.java
+++ b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksSelectDragActivity.java
@@ -152,7 +152,7 @@ protected void onCreate(Bundle savedInstanceState) {
WorldWindow wwd = this.getWorldWindow();
// Override the WorldWindow's built-in navigation behavior with conditional dragging support.
- this.controller = new SelectDragNavigateController();
+ this.controller = new SelectDragNavigateController(wwd);
wwd.setWorldWindowController(this.controller);
// Add a layer for placemarks to the WorldWindow
@@ -172,7 +172,7 @@ protected void onCreate(Bundle savedInstanceState) {
// And finally, for this demo, position the viewer to look at the placemarks
LookAt lookAt = new LookAt().set(34.150, -119.150, 0, WorldWind.ABSOLUTE, 2e4 /*range*/, 0 /*heading*/, 45 /*tilt*/, 0 /*roll*/);
- this.getWorldWindow().getNavigator().setAsLookAt(this.getWorldWindow().getGlobe(), lookAt);
+ this.getWorldWindow().cameraFromLookAt(lookAt);
}
/**
@@ -304,6 +304,10 @@ public void onLongPress(MotionEvent event) {
}
});
+ public SelectDragNavigateController(WorldWindow wwd) {
+ super(wwd);
+ }
+
/**
* Delegates events to the select/drag handlers or the native WorldWind navigation handlers.
*/
diff --git a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksStressTestActivity.java b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksStressTestActivity.java
index 549443225..838f1eb4a 100644
--- a/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksStressTestActivity.java
+++ b/worldwind-examples/src/main/java/gov/nasa/worldwindx/PlacemarksStressTestActivity.java
@@ -10,7 +10,7 @@
import java.util.Random;
-import gov.nasa.worldwind.Navigator;
+import gov.nasa.worldwind.geom.Camera;
import gov.nasa.worldwind.geom.Position;
import gov.nasa.worldwind.layer.Layer;
import gov.nasa.worldwind.layer.RenderableLayer;
@@ -94,9 +94,9 @@ public void doFrame(long frameTimeNanos) {
double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9;
double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond);
- // Move the navigator to simulate the Earth's rotation about its axis.
- Navigator navigator = getWorldWindow().getNavigator();
- navigator.setLongitude(navigator.getLongitude() - cameraDegrees);
+ // Move the camera to simulate the Earth's rotation about its axis.
+ Camera camera = getWorldWindow().getCamera();
+ camera.position.longitude -= cameraDegrees;
// Redraw the WorldWindow to display the above changes.
this.getWorldWindow().requestRedraw();
diff --git a/worldwind-examples/src/main/java/gov/nasa/worldwindx/TextureStressTestActivity.java b/worldwind-examples/src/main/java/gov/nasa/worldwindx/TextureStressTestActivity.java
index f05ff9e6e..d3fc61f95 100644
--- a/worldwind-examples/src/main/java/gov/nasa/worldwindx/TextureStressTestActivity.java
+++ b/worldwind-examples/src/main/java/gov/nasa/worldwindx/TextureStressTestActivity.java
@@ -58,9 +58,7 @@ protected void onCreate(Bundle savedInstanceState) {
// Position the viewer so that the surface images will be visible as they're added.
this.firstSector.set(35.0, 10.0, 0.5, 0.5);
this.sector.set(this.firstSector);
- this.getWorldWindow().getNavigator().setLatitude(37.5);
- this.getWorldWindow().getNavigator().setLongitude(15.0);
- this.getWorldWindow().getNavigator().setAltitude(1.0e6);
+ this.getWorldWindow().getCamera().position.set(37.5, 15.0, 1.0e6);
// Allocate a 32-bit 1024 x 1024 bitmap that we'll use to create all of the OpenGL texture objects in this test.
int[] colors = new int[1024 * 1024];
diff --git a/worldwind-examples/src/main/java/gov/nasa/worldwindx/experimental/AtmosphereLayer.java b/worldwind-examples/src/main/java/gov/nasa/worldwindx/experimental/AtmosphereLayer.java
index 554041bc3..6fcfc78bf 100644
--- a/worldwind-examples/src/main/java/gov/nasa/worldwindx/experimental/AtmosphereLayer.java
+++ b/worldwind-examples/src/main/java/gov/nasa/worldwindx/experimental/AtmosphereLayer.java
@@ -90,7 +90,7 @@ protected void determineLightDirection(RenderContext rc) {
if (this.lightLocation != null) {
rc.globe.geographicToCartesianNormal(this.lightLocation.latitude, this.lightLocation.longitude, this.activeLightDirection);
} else {
- rc.globe.geographicToCartesianNormal(rc.camera.latitude, rc.camera.longitude, this.activeLightDirection);
+ rc.globe.geographicToCartesianNormal(rc.camera.position.latitude, rc.camera.position.longitude, this.activeLightDirection);
}
}
diff --git a/worldwind-examples/src/main/res/layout/globe_content.xml b/worldwind-examples/src/main/res/layout/globe_content.xml
index 2ca2f77d6..5cdd48b10 100644
--- a/worldwind-examples/src/main/res/layout/globe_content.xml
+++ b/worldwind-examples/src/main/res/layout/globe_content.xml
@@ -82,6 +82,23 @@
android:padding="10dp"
android:text="@string/spacer"/>
+
+
+
+
+
- Basic Stress Test
Day and Night Cycle
General Purpose Globe
+ MGRS graticule Demonstration
Multi-Globe Demonstration
Movable Line of Sight
Paths Example
diff --git a/worldwind-tutorials/src/main/assets/camera_control_tutorial.html b/worldwind-tutorials/src/main/assets/camera_control_tutorial.html
index 4cd159fe6..6aa4c1977 100644
--- a/worldwind-tutorials/src/main/assets/camera_control_tutorial.html
+++ b/worldwind-tutorials/src/main/assets/camera_control_tutorial.html
@@ -19,7 +19,7 @@
Camera Control Tutorial
Demonstrates how to override the WorldWindowController gesture controller.
- This advanced example uses the Navigator's setAsCamera interface in response to touch event gestures.
+ This advanced example uses the Cameras's interface in response to touch event gestures.
- one-finger pan moves the geographic location of the camera,
- two-finger pinch-zoom adjusts the camera altitude,
@@ -37,6 +37,10 @@ CameraControlFragment.java
diff --git a/worldwind-tutorials/src/main/assets/camera_view_tutorial.html b/worldwind-tutorials/src/main/assets/camera_view_tutorial.html
index 8807db970..b88a55272 100644
--- a/worldwind-tutorials/src/main/assets/camera_view_tutorial.html
+++ b/worldwind-tutorials/src/main/assets/camera_view_tutorial.html
@@ -27,12 +27,10 @@ Example
CameraViewFragment.java
The CameraViewFragment class extends the BasicGlobeFragment and overrides the createWorldWindow method.
- Here we position the Navigator's camera at an aircraft's location and point the camera at a nearby airport.
+ Here we position the camera at an aircraft's location and point the camera at a nearby airport.