KyleLarson
KyleLarson

Reputation: 1

Certain layers are not rendering with NASA WorldWind

I am very new to NASA WorldWind Java. I am still trying to figure things out.

I have gotten to a point where I can render the Earth but haven't gotten much farther. When I look at the existing layers it says that there are political borders and Place names available but they don't show up for some reason.

Here is what I have so far:

public class Main {
        
    private static WorldWindowGLCanvas wwd;
    
    public static void main(String[] args) {
        JFrame frame = new JFrame("NASA World Wind Test");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(800, 600);
        wwd = new WorldWindowGLCanvas();
        wwd.setModel(new BasicModel());
        
        frame.getContentPane().add(wwd);
        printExistingLayers();
        frame.setVisible(true);
    }
    
    private static void printExistingLayers() {
        LayerList layers = wwd.getModel().getLayers();
                
        for(Layer layer : layers) {
            System.out.println(layer.getName());
        }
    }
}

Upvotes: 0

Views: 93

Answers (1)

Essi
Essi

Reputation: 1

I executed your code on my ArchLinux system and there was no problem with the code or NWW SDK.

public class Main {

private static WorldWindowGLCanvas wwd;

public static void main(String[] args) {
    JFrame frame = new JFrame("NASA World Wind Test");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(800, 600);
    wwd = new WorldWindowGLCanvas();
    wwd.setModel(new BasicModel());

    frame.getContentPane().add(wwd);
    frame.setVisible(true);
    printExistingLayers();

}

private static void printExistingLayers() {
    LayerList layers = wwd.getModel().getLayers();

    for(Layer layer : layers) {
        if (Objects.equals(layer.getName(), "Political Boundaries")){
            layer.setEnabled(true);
            System.out.println(layer.getMaxActiveAltitude());
            System.out.println(layer.getMinActiveAltitude());
            System.out.println(layer.getEntries());
        }
        System.out.println(layer.getName());
        System.out.println("Enabled: " + layer.isEnabled());
    }
  }
}

The problem is with NWW server for those specific layers that you mentioned. Look at BMNG256.xml which refers to BlueMarble layer and CountryBoundariesLayer.xml. You can test that the first one is active on NWW server and the second one is not. I tested them with creating these links. https://worldwind25.arc.nasa.gov/wms?service=wms&version=1.1.1&request=GetCapabilities for BlueMarble layer and https://data.worldwind.arc.nasa.gov/wms?service=wms&version=1.1.1&request=GetCapabilities for the political borders layer that you mentioned.

enter image description here

Upvotes: 0

Related Questions