I encountered several problems with the VOL add-on:
- The sample KML editor app has a compile error
- The demo app in the openlayers-wrapper-0.4.0.jar compiles but does not display a map.
- A very simple demo app shows the pan and zoom widgets, but does not display a map.
Here is the simple demo code, which looks like it should produce the same results as the initial map in the Getting Started section of the OpenLayers website:
public class VoldemoApplication extends Application {
private VerticalLayout layout = new VerticalLayout();
private HorizontalLayout controls = new HorizontalLayout();
@Override
public void init() {
final Window mainWindow = new Window("Vol example Application", layout);
setMainWindow(mainWindow);
final OpenLayersMap map = new OpenLayersMap();
// Defining a WMS layer as in OL examples
WebMapServiceLayer wms = new WebMapServiceLayer();
wms.setUri("http://vmap0.tiles.osgeo.org/wms/vmap0");
wms.setLayers("basic");
wms.setServiceType("wms");
wms.setDisplayName("OpenLayers WMS");
wms.setBaseLayer(true);
map.addLayer(wms);
map.setSizeFull();
layout.setSizeFull();
layout.addComponent(controls);
layout.addComponent(map);
layout.setExpandRatio(map, 1);
}
}
Thanks!