TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nasaworldwind/worldwindjava/llms.txt
Use this file to discover all available pages before exploring further.
gov.nasa.worldwind.layers package is the primary mechanism for adding visual content to a WorldWind globe. Every piece of imagery, elevation overlay, shape set, or annotation is managed through a layer. Layers live in the globe’s Model, accessible via a LayerList, and are processed each frame by the SceneController in the order they appear in the list.
Layer Interface
Layer extends WWObject, Disposable, and Restorable. It defines the contract every layer must satisfy.
Layer interface — key methods
Opacity semantics vary by layer type.
RenderableLayer exposes the value but defers to each individual renderable’s own opacity settings. Always consult the concrete layer’s Javadoc for precise opacity behaviour.LayerList
LayerList extends CopyOnWriteArrayList<Layer> and also implements WWObject, making it safe for concurrent reads during rendering. It is returned by Model.getLayers() and WorldWindow.getModel().getLayers().
LayerList — lookup and mutation
| Method | Description |
|---|---|
getLayerByName(String name) | Returns the first layer whose getName() equals the argument, or null. |
getLayersByClass(Class classToFind) | Returns all layers that are assignable to the given class. |
addIfAbsent(Layer layer) | Adds the layer only when not already in the list; returns true if added. |
collapseLists(LayerList[] lists) | Static utility — merges multiple LayerList arrays into one. |
getListDifference(LayerList oldList, LayerList newList) | Returns layers in newList but not oldList. |
sort() | Returns a copy sorted by layer name. |
AbstractLayer
AbstractLayer is the base class for nearly all concrete layers. It extends WWObjectImpl and provides default implementations for every Layer method.
AbstractLayer — key state fields and methods (excerpt)
AbstractLayer routes message delivery: it implements MessageListener and forwards Message objects to each Renderable in the layer that itself implements MessageListener. Subclasses override doRender(DrawContext), doPick(DrawContext, Point), and (optionally) doPreRender(DrawContext) rather than the public lifecycle methods.
RenderableLayer
RenderableLayer manages a ConcurrentLinkedQueue<Renderable> of renderable objects. It is the go-to layer for adding custom shapes, placemarks, or any Renderable to the scene.
RenderableLayer — adding and removing renderables
TiledImageLayer
TiledImageLayer is the abstract base for all tile-based imagery layers, including WMS layers and locally cached tile pyramids. It maintains a LevelSet that describes the tile pyramid and downloads or loads tiles based on current eye distance.
TiledImageLayer — key configuration
| Field / Method | Default | Description |
|---|---|---|
setDetailHint(double) | 0 | Biases tile selection; positive = finer detail at same altitude. |
setUseTransparentTextures(boolean) | false | Enables alpha channel blending for transparent tiles. |
useMipMaps (protected field) | true | Enables OpenGL mip-mapping for distant tiles. |
forceLevelZeroLoads (protected field) | false | Forces the coarsest tile level to load before higher-res tiles. |
retainLevelZeroTiles (protected field) | false | Keeps level-zero tiles in memory permanently. |
Built-in Layers
WorldWind ships with a set of ready-made layers you can add directly fromgov.nasa.worldwind.layers.
| Layer Class | Description |
|---|---|
CompassLayer | Renders a compass rose in a screen corner. |
ScalebarLayer | Draws a distance scale bar calibrated to the current view. |
WorldMapLayer | Miniature world map showing current view position. |
SkyGradientLayer | Atmospheric sky gradient rendered as a dome. |
StarsLayer | Starfield rendered outside the atmosphere. |
LatLonGraticuleLayer | Latitude/longitude graticule grid lines with labels. |
GARSGraticuleLayer | GARS (Global Area Reference System) grid overlay. |
PlaceNameLayer | Country, city, and geographic feature place name labels. |
SurfaceImageLayer | Renders geo-referenced raster images draped on the terrain. |
ViewControlsLayer | On-screen pan/zoom/tilt controls for mouse-free navigation. |
Adding built-in layers to the model