Fork me on GitHub

Basic Globe Tutorial

The globe uses the default navigation gestures:

  • one-finger pan moves the camera,
  • two-finger pinch-zoom adjusts the range to the look at position,
  • two-finger rotate arcs the camera horizontally around the look at position,
  • three-finger tilt arcs the camera vertically around the look at position.

Get Started

It’s very easy to get started using WorldWind Android. You simply create and configure a WorldWindow View object and add it to a layout. This can be performed in an Activity or a Fragment. The following snippet shows the code that creates the WorldWindow and adds some imagery to the globe.

// Create a WorldWindow (a GLSurfaceView)...
WorldWindow wwd = new WorldWindow(getContext());
// ... and add some map layers
wwd.getLayers().addLayer(new BackgroundLayer());
wwd.getLayers().addLayer(new BlueMarbleLandsatLayer());


In this example, we add WorldWindow to a Fragment’s layout in its onCreateView() callback. onCreateView() creates the WorldWind view object and adds the view to the Fragment’s FrameLayout.

Class Diagram

This class diagram shows the primary WorldWind classes used in the Fragment.

public class BasicGlobeFragment extends Fragment {

    private WorldWindow wwd;

    public BasicGlobeFragment() {

     * 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());
        return this.wwd;

     * Gets the WorldWindow (GLSurfaceView) object.
    public WorldWindow getWorldWindow() {
        return this.wwd;

     * Adds the WorldWindow to this Fragment's layout.
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_globe, container, false);
        FrameLayout globeLayout = (FrameLayout) rootView.findViewById(;

        // Add the WorldWindow view object to the layout that was reserved for the globe.

        return rootView;

     * Resumes the WorldWindow's rendering thread
    public void onResume() {
        this.wwd.onResume(); // resumes a paused rendering thread

     * Pauses the WorldWindow's rendering thread
    public void onPause() {
        this.wwd.onPause(); // pauses the rendering thread


A FrameLayout hosts the WorldWindow.


    <!--WorldWindow Globe panel-->


NASA WorldWind Project Notice

Currently WorldWind is undergoing system evaluation. We will not be able to accept any software update requests. WorldWind users can continue to access the NASA servers and SDKs, available on Github. More information will be provided in the near future.