NASAWorldWind / WorldWindJava

The NASA WorldWind Java SDK (WWJ) is for building cross-platform 3D geospatial desktop applications in Java.
714 stars 324 forks source link

On WorldWind Java 2.2.0, I cannot display the OpenMapStreet map with the OSMMapnikLayer() #222

Open Conan42 opened 3 years ago

Conan42 commented 3 years ago

Hello,

On WorldWind Java 2.2.0, I cannot display the OpenMapStreet map with the OSMMapnikLayer(). Do you have an idea?

Code:

import gov.nasa.worldwind.BasicModel; import gov.nasa.worldwind.Model; import gov.nasa.worldwind.awt.WorldWindowGLCanvas; import gov.nasa.worldwind.globes.Earth; import gov.nasa.worldwind.globes.Globe; import gov.nasa.worldwind.layers.; import gov.nasa.worldwind.layers.Earth.; import javax.swing.*;

public class SimplestPossibleExample extends JFrame { public SimplestPossibleExample() { WorldWindowGLCanvas wwd = new WorldWindowGLCanvas(); wwd.setPreferredSize(new java.awt.Dimension(1000, 800)); getContentPane().add(wwd, java.awt.BorderLayout.CENTER);

    Globe earth = new Earth();

    Layer[] layers = new Layer[]
            {
                    new OSMMapnikLayer(),
                    new StarsLayer(),
                    new LatLonGraticuleLayer(),
            };

    Model model = new BasicModel();
    model.setGlobe(earth);
    model.setLayers(new LayerList(layers));
    wwd.setModel(model);

}

public static void main(String[] args)
{
    java.awt.EventQueue.invokeLater(() -> {
        JFrame frame = new SimplestPossibleExample();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    });
}

}

quonn77 commented 3 years ago

Can you report the log of the operation?... Are you trying to connect behind a proxy?

Il ven 26 mar 2021, 20:11 Conan42 @.***> ha scritto:

Hello,

On WorldWind Java 2.2.0, I cannot display the OpenMapStreet map with the OSMMapnikLayer(). Do you have an idea?

Code:

import gov.nasa.worldwind.BasicModel; import gov.nasa.worldwind.Model; import gov.nasa.worldwind.awt.WorldWindowGLCanvas; import gov.nasa.worldwind.globes.Earth; import gov.nasa.worldwind.globes.Globe; import gov.nasa.worldwind.layers. ; import gov.nasa.worldwind.layers.Earth.; import javax.swing.*;

public class SimplestPossibleExample extends JFrame { public SimplestPossibleExample() { WorldWindowGLCanvas wwd = new WorldWindowGLCanvas(); wwd.setPreferredSize(new java.awt.Dimension(1000, 800)); getContentPane().add(wwd, java.awt.BorderLayout.CENTER);

Globe earth = new Earth();

Layer[] layers = new Layer[]
        {
                new OSMMapnikLayer(),
                new StarsLayer(),
                new LatLonGraticuleLayer(),
        };

Model model = new BasicModel();
model.setGlobe(earth);
model.setLayers(new LayerList(layers));
wwd.setModel(model);

}

public static void main(String[] args) { java.awt.EventQueue.invokeLater(() -> { JFrame frame = new SimplestPossibleExample(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); }); }

}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NASAWorldWind/WorldWindJava/issues/222, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLC3B47VAYP6YT2MEPUYRDTFTL4LANCNFSM4Z36EKXQ .

Conan42 commented 3 years ago

Hi Alessio, there is no log on the Intellij Idea Run output window. and There is no proxy. It seems to download the tiles, but we cannot see the Mapnik map, whereas with the layer BMNGWMSLayer () it works.