OpenLayers Vaadin Addon: OpenStreetMap,Google, GeoServer integration

Hi, I have experienced some problem in trying to integrate Geoserver together with OpenStreetMap and Google Maps, I have already done it with pure javascript and html and it is just matter of set the proper option on the openlayers.map object. When using your component , what I am experiencing is that setting the JsMapOptions (setJsMapOptions method of OpenLayersMap class) work only the first time I open a window that embed the openlayers component…next calls seems to nullify the jsMapOptions…I have solved this by means
of a workaround (I wasnt able to track why the jsMapOptions is null on successive calls). The workaround consist of declaring on org.vaadin.vol.client.wrappers.Map default options to give to the openlayers map object. Do you have any idea on how to track , or how to fix this problem?

On the constructor i have just added

this.mapInitOptions=getDefaultMapOptions();

and declared the method

public final static String getDefaultMapOptions() {

               String options = "{"
                               + "projection : new $wnd.OpenLayers.Projection(\"EPSG:900913\"),"
                               + "displayProjection : new $wnd.OpenLayers.Projection(\"EPSG:4326\"),"
                               + "units : \"m\","
                               + "theme : null,"
                               + "numZoomLevels : 18,"
                               + "maxResolution : 2000.0339,"
                               + "maxExtent : new OpenLayers.Bounds(-20037508, -20037508,20037508, 20037508)"
                               + "}";
               return options;
}

Regards Alessio

Hi,

I made a small change to code as it appeared to be painted in a different way than other properties. I didn’t test it, but I hope it fixes the issue.

If you don’t use SVN builds, there is a snapshot release (r53) in the google code project.

cheers,
matti