Copy OpenLayersWrapper map to another subwindow, how?

I welcome!

I am writing functional print maps with the parameters display information (such as the date of begin of the period, transit, etc.) - i want all this information is displayed in a separate subwindow, namely -

  • The map plotted with objects (popup, markers);
  • The parameters selected by the user.

It is possible, whether as a copy map in a subwindow?

I would greatly appreciate! :smiley:

Map presented in a way -


...
	public OpenLayersMap getStartOpenLayersMap() {
	   openLayersMap.setImmediate(true);
	   wms = new WebMapServiceLayer();
	   wms.setUri(wmsGeoServerLayer);
	   wms.setLayers(wmsGeoServerLayerName);
	   wms.setFormat(wmsGeoServerLayerFormat);
	   wms.setTransparent(true);
	   wms.setBaseLayer(true);	   
	   wms.setCqlFilter("");	   
	   
	   openLayersMap.getExtend();
	   	   
	   openLayersMap.addLayer(wms);
	   openLayersMap.setSizeFull();	         
	   openLayersMap.setCenter(100.65130, 55.69964);
	   openLayersMap.setZoom(3);
	   openLayersMap.addControl(Control.ScaleLine);
	   openLayersMap.addControl(Control.LayerSwitcher);
	   openLayersMap.addControl(Control.MousePosition);
	   openLayersMap.addControl(Control.OverviewMap);

	   return openLayersMap; 
	}

...

…and added to the panel as the second component -


...
horizontalSplitPanel.addComponent(mapUpdater.getStartOpenLayersMap());
...

Cheers,
Thx
12105.png

Does anyone know? :smiley:

The following code somehow removes the map from the previous place, and hangs the system -


...
Window printPreviewWindow = new Window();
printPreviewWindow.addComponent(horizontalSplitPanel.getSecondComponent());
window.addWindow(printPreviewWindow);
...

Why? :dry:

Hi,

I think this might be an issue in OpenLayers or the wrapper. The complex js magic don’t necessary support relocating the same map instance on the client side. This is just a guess though, I have never tried that.

Implementing Cloneable on the server side or making the clone “manually” with own helper function would most likely work better. Performance wise I’d say this cannot be a problem. If you decide to implement the former, I’d appreciate a patch that I can commit to the project.

cheers,
matti

I welcome you, Matti Tahvonen!

Thank you very much for the information, Matti! I shall return to this issue later and may try to write a patch.
It seems that it is indispensable, nice to have a preview window before printing.

Cheers,
Thx