@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 }
/** * Prepares this WorldWindow for drawing and event handling. * * @param configChooser optional argument for choosing an EGL configuration; may be null */ protected void init(EGLConfigChooser configChooser) { // Initialize the WorldWindow's navigator. Location initLocation = Location.fromTimeZone(TimeZone.getDefault()); double initAltitude = this.distanceToViewGlobeExtents() * 1.1; // add 10% to the minimum distance to allow for space around the screen edges this.navigator.setLatitude(initLocation.latitude); this.navigator.setLongitude(initLocation.longitude); this.navigator.setAltitude(initAltitude); // Initialize the WorldWindow's controller. this.worldWindowController.setWorldWindow(this); // Initialize the WorldWindow's render resource cache. int cacheCapacity = RenderResourceCache.recommendedCapacity(this.getContext()); this.renderResourceCache = new RenderResourceCache(cacheCapacity); // Set up to render on demand to an OpenGL ES 2.x context // TODO Investigate and use the EGL chooser submitted by jgiovino this.setEGLConfigChooser(configChooser); this.setEGLContextClientVersion(2); // must be called before setRenderer this.setRenderer(this); this.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); // must be called after setRenderer // Log a message with some basic information about the WorldWindow's configuration. Logger.log(Logger.INFO, "WorldWindow initialized"); }
@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); }
wwd.getNavigator().setAltitude(4.0e5);
wwd.getNavigator().setAltitude(10e3);