Openlayers wrapper - proxy server

I am developing a new version of our webapplication where i add the Openlayers wrapper.
Now the past two days openlayers.org url has been some laggy and even was offline for a while.
Resulting my webapp (and also the examples on the web) not loading or loading slowly at times.
Is there a way to select an other proxy in the wrapper ?

i noticed here :
openlayers proxy example
that there are some proxy servers around.

How can i prevent my webapp from getting stuck when openlayers.org is down or even better how can i select a different proxy if i is down?

thanks in advange.

Hi,

I think you don’t need a proxy for your issue. Although the add-on by default suggests to use a widget set that uses the OL script form openlayers.org, you can also use a version where you can host the script by yourself:

In this case you can e.g. modify the widget set (.gwt.xml file) like this:


        <!-- WS Compiler: manually edited -->
        <!--  USE THIS IF YOU DON'T WANT TO USE THE HOSTED OL API -->
        <inherits name="org.vaadin.vol.VolWidgetset" />
        
        <!-- Your version of openlayers -->
        <script src="OpenLayers.js"></script>

And then add the OpenLayers.js file to “public” directory next to your widget set file. Now the script is not fetched from openlayers.org website, but from the same location as your Vaadin widgetset. This way you can also save quite a few bytes if you build your own optimized script and remove all parts you don’t need. See e.g. this help page:
http://docs.openlayers.org/library/deploying.html

cheers,
matti

Hi,

sorry for jumping into this thread but I have “sort of” the same problem.
Our application needs to be hosted on an https server thus calling a JS from http (not talking about external resources) is not ideal, plus some standard browser configurations would prevent loading mixed content.
Since we are already hosting some JS applications that use Openlayers I was thinking of re-using the same “local” installation.
I have tried to add the script part to my widget set file like this :

<script src="https://my.server/map/OpenLayers/OpenLayers.js"></script>

I tested the location and the file is correctly loaded from a the browser but when I deploy it somehow the VOL plugin still loads from http://openlayers.org/api/2.12/OpenLayers.js
any clues ?

TIA

[update]

I tried inheriting from VolWidgetsetWithHostedScript and VolWidgetset in my widgetset but had no luck ( actually, inheriting from VolWidgetset directly causes warning in widgetset compilation). The only solution I have found so far (hopefully temporary) is in editing the script value of VolWidgetsetWithHostedScript.gwt.xml

Hi,

You should only inherit the VolWidgetset. Comment out the VolWidgetsetWithHostedScript from your application widgetset.

cheers,
matti