@Override public void creationSucceeded(LayerFactory factory, Layer layer) { // Add the finished WMS layer to the WorldWindow. getWorldWindow().getLayers().addLayer(layer); Log.i("gov.nasa.worldwind", "WMS layer creation succeeded"); }
@Override public void creationSucceeded(LayerFactory factory, Layer layer) { // Add the finished WMTS layer to the WorldWindow. getWorldWindow().getLayers().addLayer(layer); Log.i("gov.nasa.worldwind", "WMTS layer creation succeeded"); }
/** * Updates the WorldWindow layer list on the UI Thread and starts the animation. */ @Override protected void onPostExecute(Void notUsed) { super.onPostExecute(notUsed); getWorldWindow().getLayers().addLayer(this.airportLayer); getWorldWindow().getLayers().addLayer(this.aircraftLayer); statusText.setText(""); PlacemarksMilStd2525DemoActivity.this.startAnimation(); }
private WorldWindow createWorldWindow() { // Create the WorldWindow (a GLSurfaceView) which displays the globe. WorldWindow wwd = new WorldWindow(this); // Setup the WorldWindow's layers. wwd.getLayers().addLayer(new BackgroundLayer()); wwd.getLayers().addLayer(new BlueMarbleLandsatLayer()); wwd.getLayers().addLayer(new AtmosphereLayer()); this.worldWindows.add(wwd); return wwd; }
/** * Updates the WorldWindow layer list on the UI Thread. */ @Override protected void onPostExecute(Void notUsed) { super.onPostExecute(notUsed); getWorldWindow().getLayers().addLayer(this.placeLayer); statusText.setText(String.format(Locale.US, "%,d US places created", this.numPlacesCreated)); getWorldWindow().requestRedraw(); }
/** * Creates a new WorldWindow with a tessellation layer. */ @Override public WorldWindow createWorldWindow() { // Let the super class (BasicGlobeFragment) do the creation WorldWindow wwd = super.createWorldWindow(); // Create a layer that displays the globe's tessellation geometry. ShowTessellationLayer layer = new ShowTessellationLayer(); wwd.getLayers().addLayer(layer); return wwd; } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_placemarks_milstd2525_stress_test)); setAboutBoxText("Demonstrates a LOT of different MIL-STD-2525 symbols."); // 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); this.getWorldWindow().getLayers().clearLayers(); this.getWorldWindow().getLayers().addLayer(new ShowTessellationLayer()); // 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. new InitializeSymbolsTask().execute(); }
/** * Creates a new WorldWindow (GLSurfaceView) object. */ public WorldWindow createWorldWindow() { // Create the WorldWindow (a GLSurfaceView) which displays the globe. this.wwd = new WorldWindow(getContext()); // Setup the WorldWindow's layers. this.wwd.getLayers().addLayer(new BackgroundLayer()); this.wwd.getLayers().addLayer(new BlueMarbleLandsatLayer()); // Setup the WorldWindow's elevation coverages. this.wwd.getGlobe().getElevationModel().addCoverage(new BasicElevationCoverage()); return this.wwd; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_paths_example)); setAboutBoxText("Demonstrates Paths used to animate aircraft great-circle routes from Seattle to other US airports."); this.readAirportTable(); this.populateFlightPaths(); this.getWorldWindow().getLayers().addLayer(this.flightPathLayer); }
@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); // Establish the activity content setContentView(this.layoutResourceId); setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_basic_globe)); setAboutBoxText("Demonstrates how to construct a WorldWindow with a few layers.\n" + "The globe uses the default navigation gestures: \n" + " - one-finger pan moves the camera,\n" + " - two-finger pinch-zoom adjusts the range to the look at position, \n" + " - two-finger rotate arcs the camera horizontally around the look at position,\n" + " - three-finger tilt arcs the camera vertically around the look at position."); // Create the WorldWindow (a GLSurfaceView) which displays the globe. this.wwd = new WorldWindow(this); // Add the WorldWindow view object to the layout that was reserved for the globe. FrameLayout globeLayout = (FrameLayout) findViewById(R.id.globe); globeLayout.addView(this.wwd); // Setup the WorldWindow's layers. this.wwd.getLayers().addLayer(new BackgroundLayer()); this.wwd.getLayers().addLayer(new BlueMarbleLandsatLayer()); this.wwd.getLayers().addLayer(new AtmosphereLayer()); // Setup the WorldWindow's elevation coverages. this.wwd.getGlobe().getElevationModel().addCoverage(new BasicElevationCoverage()); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_texture_stress_test)); this.setAboutBoxText("Continuously allocates OpenGL texture objects to test the effect of an excessive number of textures on the WorldWind render resource cache."); // Setup the WorldWindow to display the tessellation layer and a layer of surface images. We use a minimal // layer configuration in order to gather precise metrics on memory usage. this.getWorldWindow().getLayers().clearLayers(); this.getWorldWindow().getLayers().addLayer(new ShowTessellationLayer()); this.getWorldWindow().getLayers().addLayer(this.layer); // 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); // 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]; Arrays.fill(colors, 0xFF00FF00); this.bitmap = Bitmap.createBitmap(colors, 1024, 1024, Bitmap.Config.ARGB_8888); }
@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()); }
@Override public void creationSucceeded(LayerFactory factory, Layer layer) { // Add the finished GeoPackage layer to the WorldWindow. getWorldWindow().getLayers().addLayer(layer); // Place the viewer directly over the GeoPackage image. getWorldWindow().getNavigator().setLatitude(36.8139677556754); getWorldWindow().getNavigator().setLongitude(-76.03260320181615); getWorldWindow().getNavigator().setAltitude(20e3); Log.i("gov.nasa.worldwind", "GeoPackage layer creation succeeded"); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_basic_stress_test)); this.setAboutBoxText("Continuously moves the navigator in an Easterly direction from a low altitude."); // Add the ShowTessellation layer to provide some visual feedback regardless of texture details this.getWorldWindow().getLayers().addLayer(new ShowTessellationLayer()); // Initialize the Navigator so that it's looking in the direction of movement and the horizon is visible. Navigator navigator = this.getWorldWindow().getNavigator(); navigator.setAltitude(1e3); // 1 km navigator.setHeading(90); // looking east navigator.setTilt(75); // looking at the horizon }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_day_night_cycle)); setAboutBoxText("Demonstrates how to display a continuous day-night cycle on the WorldWind globe.\n" + "This gradually changes both the Navigator's location and the AtmosphereLayer's light location."); // Initialize the Atmosphere layer's light location to our custom location. By default the light location is // always behind the viewer. LayerList layers = this.getWorldWindow().getLayers(); this.atmosphereLayer = (AtmosphereLayer) layers.getLayer(layers.indexOfLayerNamed("Atmosphere")); this.atmosphereLayer.setLightLocation(this.sunLocation); // Initialize the Navigator so that the sun is behind the viewer. Navigator navigator = this.getWorldWindow().getNavigator(); navigator.setLatitude(20); navigator.setLongitude(this.sunLocation.longitude); // Use this Activity's Choreographer to animate the day-night cycle. Choreographer.getInstance().postFrameCallback(this); }
wwd.getLayers().addLayer(sightlineLayer);
layer.addRenderable(surfaceImageResource); layer.addRenderable(surfaceImageUrl); wwd.getLayers().addLayer(layer);
/** * 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; }
sightlineLayer.addRenderable(this.sightline); sightlineLayer.addRenderable(this.sightlinePlacemark); this.wwd.getLayers().addLayer(sightlineLayer);