Vaadin OpenLayers Add-on problems

I encountered several problems with the VOL add-on:

  1. The sample KML editor app has a compile error
  2. The demo app in the openlayers-wrapper-0.4.0.jar compiles but does not display a map.
  3. 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!

I got the simple demo (item 3) to show the map by clicking on the zoom widget. I added a map.setZoom call to the code, but it would still not show the map until I clicked the zoom widget.

Hi,

All my examples set both center and zoom on initialization. The client side code probably bugs if those are not set. Would you create a ticket to the
project page
so I don’t forget it? We’ll also hopefully get a more active developer for the project soon from Netherlands, so it is better to have all the issues centralized somewhere else than in my mind.

The KML editor project currently uses a svn version of the wrapper. In case you want to start with that project, also check out the actual vaadin open layers wrapper project from the svn and run “mvn install” to install an up to date copy of the wrapper. If you are not using maven just let me know and I’ll publish a new version to the directory right away. The svn version contains some enhancements for drawing.

__
cheers,
matti