Listeners for zoom and pan on an openlayers map

Hello everyone,

I’d like to listen to the OL events, which are fired, when I zoom or pan on an OL map.
I want to add extra functionalities, if the user zooms or pans. So I need a listener for these events.
Is there any way with the OpenLayers Wrapper Addon for Vaadin or do I have to implement this on myself?

I’ve seen an approach with

but I don’t think it’s implemented in the Addon, is it?

Thanks a lot!

Regards
Axel

Thankfully, someone had the same problem:


listener for update extend needed

So, I’ve solved my problem the following way (work around):


	@Override
	public void init() {
		Window w = new Window();
		setMainWindow(w);
		w.setHeight("500px");
		final OpenLayersMap map = new OpenLayersMap() {
			@Override
			protected void updateExtent(java.util.Map<String, Object> variables) {
				super.updateExtent(variables);
				System.out.println("Extend changed");
			};
		};
		map.setHeight("500px");
		map.setWidth("100%");
		map.setJsMapOptions("{"
				+ "projection : new $wnd.OpenLayers.Projection(\"EPSG:900913\"),"
				+ "displayProjection : new $wnd.OpenLayers.Projection(\"EPSG:4326\"),"
				+ "units : \"m\","
				+ "maxResolution : 156543.0339,"
				+ "maxExtent : new OpenLayers.Bounds(-20037508.34,-20037508.34, 20037508.34, 20037508.34)"
				+ "}");
		OpenStreetMapLayer osm = new OpenStreetMapLayer();

	
		map.setImmediate(true);
		map.addLayer(osm);
		map.setCenter(8.2274782, 49.9885229);
		map.setZoom(17);
		w.addComponent(map);

		map.addControl(Control.OverviewMap);
		map.addControl(Control.ScaleLine);
		map.addControl(Control.PanZoomBar);
	}

Just override the updateExtend, inject your functionality there and remember to setImmediate(true);
That was easy, thank you!

Regards
Axel

hello world !
anyone who know : how recuperate the zoom postion in vaadin openlayers map , so i know getzoom() method but i need the zoom level position ,
help me