GWT-OpenLayers WMS layer hides base map

946 views Asked by At

I am an OpenLayers and GeoServer newbie and any help is greatly appreciated!

I am loading a base map using the code from the Bing Maps example.

final String key = "Apd8EWF9Ls5tXmyHr22OuL1ay4HRJtI4JG4jgluTDVaJdUXZV6lpSBpX-TwnoRDG";
// Bing key
Bing road = new Bing(new BingOptions("Road Layer", key, BingType.ROAD));
Bing hybrid = new Bing(new BingOptions("Hybrid Layer", key,
                BingType.HYBRID));
Bing aerial = new Bing(new BingOptions("Aerial Layer", key,
                BingType.AERIAL));
// And add them to the map
map.addLayer(road);
map.addLayer(hybrid);
map.addLayer(aerial);

Then I load my WMS layer using this code that I came up with from some of the other examples.

WMSParams wmsParams = new WMSParams();
wmsParams.setFormat("image/png");
wmsParams.setLayers("test:myraster");
wmsParams.setStyles("");

WMSOptions wmsLayerParams = new WMSOptions();
wmsLayerParams.setIsBaseLayer(false);
wmsLayerParams.setAlwaysInRange(true);
wmsLayerParams.setUntiled();
wmsLayerParams.setWrapDateLine(true);

String wmsUrl = "http://localhost:8080/geoserver/wms";

WMS wmsLayer = new WMS("Basic WMS", wmsUrl, wmsParams, wmsLayerParams);
map.addLayer(wmsLayer);

I also have the layer switcher control on the map so I can toggle the layers.

LayerSwitcher layerSwitcher = new LayerSwitcher();
map.addControl(layerSwitcher);

When my map loads, I see that the bing maps are my base layers in the layer switcher and my wms layer is the overlay layer. The problem is that when my wms layer is visible, I cannot see the base layer. My raster that I am trying to display through the wms layer is only 10 degrees by 10 degrees and it seems as though all the other space is being filled with white instead of allowing me to see the base layer underneath. When I toggle my wms layer off, I can see the base layer.

Does anyone have any suggestions?

0

There are 0 answers