@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_placemarks_demo)); setAboutBoxText("Demonstrates LOTS (38K) of Placemarks with various levels of detail.\n\n" + "Placemarks are conditionally displayed based on the camera distance: \n" + " - symbols are based on population and capitol status,\n" + " - zoom in to reveal more placemarks,\n" + " - picking is supported, touch a placemark to see the place name."); // Add a TextView on top of the globe to convey the status of this activity this.statusText = new TextView(this); this.statusText.setTextColor(android.graphics.Color.YELLOW); FrameLayout globeLayout = (FrameLayout) findViewById(R.id.globe); globeLayout.addView(this.statusText); // Override the WorldWindow's built-in navigation behavior by adding picking support. this.getWorldWindow().setWorldWindowController(new PickController()); new CreatePlacesTask().execute(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_paths_and_polygons)); setAboutBoxText("Demonstrates place names rendered as labels, world highways rendered as paths " + "and countries rendered as polygons with random interior colors. \n\n" + "The name of the object(s) are displayed when picked."); // Add a TextView on top of the globe to convey the status of this activity this.statusText = new TextView(this); this.statusText.setTextColor(android.graphics.Color.YELLOW); FrameLayout globeLayout = (FrameLayout) findViewById(R.id.globe); globeLayout.addView(this.statusText); // Override the WorldWindow's built-in navigation behavior by adding picking support. this.getWorldWindow().setWorldWindowController(new PickController()); this.getWorldWindow().getLayers().addLayer(this.shapesLayer); // Load the shapes into the renderable layer statusText.setText("Loading countries...."); new CreateRenderablesTask().execute(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_basic_performance_benchmark)); this.setAboutBoxText("Executes a basic performance benchmark, logging the accumulated frame statistics."); // Suppress the WorldWindow's built-in navigation behavior. WorldWindow wwd = this.getWorldWindow(); wwd.setWorldWindowController(new NoOpWorldWindowController()); // Add a layer containing a large number of placemarks. this.getWorldWindow().getLayers().addLayer(this.createPlacemarksLayer()); }
/** * Creates a new WorldWindow object with a custom WorldWindowController. */ @Override public WorldWindow createWorldWindow() { // Let the super class (BasicGlobeFragment) do the creation WorldWindow wwd = super.createWorldWindow(); // Override the default "look at" gesture behavior with a camera centric gesture controller wwd.setWorldWindowController(new CameraController()); // Create a camera position above KOXR airport, Oxnard, CA Camera camera = new Camera(); camera.set(34.2, -119.2, 10000, WorldWind.ABSOLUTE, 90, // Looking east 70, // Lookup up from nadir 0); // No roll // Apply the new camera position Globe globe = wwd.getGlobe(); wwd.getNavigator().setAsCamera(globe, camera); return wwd; }
wwd.setWorldWindowController(this.controller);
/** * Creates a new WorldWindow (GLSurfaceView) object with a WMS Layer * * @return The WorldWindow object containing the globe. */ @Override public WorldWindow createWorldWindow() { // Let the super class (BasicGlobeFragment) do the creation WorldWindow wwd = super.createWorldWindow(); // Override the WorldWindow's built-in navigation behavior by adding picking support. wwd.setWorldWindowController(new PickNavigateController()); // Add a layer for placemarks to the WorldWindow RenderableLayer layer = new RenderableLayer("Placemarks"); wwd.getLayers().addLayer(layer); // Create a few placemarks with highlight attributes and add them to the layer layer.addRenderable(createAirportPlacemark(Position.fromDegrees(34.2000, -119.2070, 0), "Oxnard Airport")); layer.addRenderable(createAirportPlacemark(Position.fromDegrees(34.2138, -119.0944, 0), "Camarillo Airport")); layer.addRenderable(createAirportPlacemark(Position.fromDegrees(34.1193, -119.1196, 0), "Pt Mugu Naval Air Station")); layer.addRenderable(createAircraftPlacemark(Position.fromDegrees(34.15, -119.15, 2000))); // Position the viewer to look near the airports LookAt lookAt = new LookAt().set(34.15, -119.15, 0, WorldWind.ABSOLUTE, 2e4 /*range*/, 0 /*heading*/, 45 /*tilt*/, 0 /*roll*/); wwd.getNavigator().setAsLookAt(wwd.getGlobe(), lookAt); return wwd; }
this.wwd.setWorldWindowController(this.controller);