Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
WMS Image Layer for OpenLayers 3 Wrapper
I am using the OpenLayers 3 add-on for Vaadin (https://vaadin.com/directory#!addon/openlayers-3-wrapper-for-vaadin) which has been really useful.
My problem is thus: I am working on a restricted network which does not have access to the Internet. What I am trying to do is allow the User to enter a WMS URLand then present (via a OptionGroup UI object a list of the layers available). The user can select an aforementioned layer and it will be loaded from the WMS server (more than likely geoserver) on the local network as an image layer.
I am using the NASA WorldWind WMS classes to get the WMS capabilities and presenting this correctly to the User (I couldn't find a better implementation using any of the classes provided by the OpenLayers 3 wrapper classes).
The following code then tries to create an OLSource object to display as a map. The problem is - no map.
The following code is my actual implementation so far (WMSLayerCapabilities is a NASA Worldwind class which wrapper the GetCapabilitiies response in an object).
WMSLayerCapabilities selectedLayer = aimeOpenLayers
.getSelectedLayer();
// Set the WMS source data
OLImageWMSSourceOptions options = new OLImageWMSSourceOptions();
options.setUrl(aimeOpenLayers.getSelectedUri().toString());
Map<String, String> params = new HashMap<String, String>();
params.put("LAYERS", selectedLayer.getName());
params.put("FORMAT", "image/png"); // need to change this to get the supported images from the WMSLayerCapabilities object
// params.put("TRANSPARENT", "true");
options.setParams(params);
// Set the source data
source = new OLImageWMSSource(options);
But again no map. Am I missing something (well obviously I am) on either the OLImageWMSSourceOptions or the OLImageWMSSource objects.
I've tried a hard coded implementation using an Internet connection to test if a map can be drawn using the OLImageWMSSource below but again - no map
protected OLSource createTestSource()
{
AimeLogger.getLogger().info("USING INTERNET SOURCED WMS");
OLImageWMSSourceOptions options = new OLImageWMSSourceOptions();
options.setUrl("http://129.206.228.72/cached/osm");
options.setProjection("CRS:84");
Map<String, String> params = new HashMap<String, String>();
params.put("LAYERS", "osm_auto:all");
params.put("FORMAT", "image/png");
options.setParams(params);
return new OLImageWMSSource(options);
}
Any help at all would be very much appreciated.
Many thanks, Mike (QinetiQ Simulation & Training, UK)