Skip to content

Commit

Permalink
default to Bing Imagery as MSVirtualEarthLayers no longer work
Browse files Browse the repository at this point in the history
  • Loading branch information
lveci committed Jun 13, 2022
1 parent bf022e6 commit 0e4840d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ private void fill(WorldWindow wwd) {
for (Layer layer : wwd.getModel().getLayers()) {

if (layer.getName().equalsIgnoreCase("Atmosphere") || layer.getName().equalsIgnoreCase("World Map") ||
layer.getName().equalsIgnoreCase("Scale bar") || layer.getName().equalsIgnoreCase("Compass"))
layer.getName().equalsIgnoreCase("Scale bar") || layer.getName().equalsIgnoreCase("Compass") ||
layer.getName().equalsIgnoreCase("Stars"))
continue;

final LayerAction action = new LayerAction(layer, wwd, layer.isEnabled());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private LayerList getValidLayers() {
for (Layer l : allLayers) {
if (l.getName().equalsIgnoreCase("Atmosphere") || l.getName().equalsIgnoreCase("World Map") ||
l.getName().equalsIgnoreCase("Scale bar") || l.getName().equalsIgnoreCase("Compass") ||
l.getName().equalsIgnoreCase("NASA Blue Marble Image"))
l.getName().equalsIgnoreCase("Stars") || l.getName().equalsIgnoreCase("NASA Blue Marble Image"))
continue;
if (l.getName().equalsIgnoreCase("MS Bing Aerial"))
virtualEarthAerialLayer = l;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,6 @@ protected Object doInBackground() throws Exception {
wwjPanel.addLayerPanelLayer();
wwjPanel.addElevation();

final MSVirtualEarthLayer virtualEarthLayerA = new MSVirtualEarthLayer(MSVirtualEarthLayer.LAYER_AERIAL);
virtualEarthLayerA.setName("MS Bing Aerial");
insertTiledLayer(getWwd(), virtualEarthLayerA);

final MSVirtualEarthLayer virtualEarthLayerR = new MSVirtualEarthLayer(MSVirtualEarthLayer.LAYER_ROADS);
virtualEarthLayerR.setName("MS Bing Roads");
virtualEarthLayerR.setEnabled(false);
insertTiledLayer(getWwd(), virtualEarthLayerR);

final MSVirtualEarthLayer virtualEarthLayerH = new MSVirtualEarthLayer(MSVirtualEarthLayer.LAYER_HYBRID);
virtualEarthLayerH.setName("MS Bing Hybrid");
virtualEarthLayerH.setEnabled(false);
insertTiledLayer(getWwd(), virtualEarthLayerH);

final OSMMapnikLayer streetLayer = new OSMMapnikLayer();
streetLayer.setOpacity(0.7);
streetLayer.setEnabled(false);
Expand Down Expand Up @@ -208,6 +194,8 @@ protected Object doInBackground() throws Exception {
layerList.add(fixingPlaceNameLayer);
fixingPlaceNameLayer.setEnabled(true);

final Layer bingLayer = layerList.getLayerByName("Bing Imagery");
bingLayer.setEnabled(true);

// Put the pieces together.
mainPane.add(wwjPanel, BorderLayout.CENTER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package org.esa.snap.worldwind;

import gov.nasa.worldwind.layers.Earth.MSVirtualEarthLayer;
import gov.nasa.worldwind.layers.Layer;
import gov.nasa.worldwind.layers.LayerList;
import org.esa.snap.core.datamodel.ProductNode;
Expand All @@ -37,9 +36,7 @@
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.border.EmptyBorder;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Window;
import java.awt.*;

import static org.esa.snap.rcp.SnapApp.SelectionSourceHint.VIEW;

Expand Down Expand Up @@ -119,9 +116,8 @@ protected Object doInBackground() {

final LayerList layerList = getWwd().getModel().getLayers();

final MSVirtualEarthLayer virtualEarthLayerA = new MSVirtualEarthLayer(MSVirtualEarthLayer.LAYER_AERIAL);
virtualEarthLayerA.setName("MS Bing Aerial");
layerList.add(virtualEarthLayerA);
final Layer bingLayer = layerList.getLayerByName("Bing Imagery");
bingLayer.setEnabled(true);

final WWLayerDescriptor[] wwLayerDescriptors = WWLayerRegistry.getInstance().getWWLayerDescriptors();
for (WWLayerDescriptor layerDescriptor : wwLayerDescriptors) {
Expand Down

0 comments on commit 0e4840d

Please sign in to comment.