OpenLayers Wrapper - WMS Service

Hello everybody!

First I’d like to thank you for this magnificent open layers add-on. Exactly what I searched for…

In my project I’d like to offer the possibility to display maps and meta information of user provided wms files (xml file).

I managed to request and display specific layers of the provided wms but as there are a lot of layers and I want to offer them all …
is there a possibility to simply add all layers at once?
Or do I have to write a piece of code which reads the provided xml file?

Second question … the displayed layers do load very slowly (tile after tile) and do reload after every zoom request.
Is there a possibility to cache them temporary?

Furthermore the layers only display at zoom level 4 or lower…
do I have the wrong resolution set or do I have to limit the zoom levels?

Last question concerns metainformation. I’d like to display point information and therefore need to detect MouseClickEvents on the map. Unfortunately I did not manage adding an ClickEventListener to the OpenLayersMap as seen
. Any hint on that?

Thanks in advance, Stefan


You are welcome! It would be great to hear what kind of GIS solution you are building. There are some quite cool application already built with this combo and I’m about to write a blog entry about this kind of (Vaadin based) GIS apps.

For the first question I didn’t get good enough idea what you are doing. I’m still afraid that you still need to do some coding :slight_smile:

Second question: if you are using WMS layers and tiles are loading slowly, the optimization would need to be done in the map server that is providing the WMS service. OpenLayers itself cannot do any magic here. Tuning WMS server isn’t my special area and optimizations are server specific. One viable option, especially if you don’t govern the server yourself, is to setup a proxy server that caches tiles read from the backend server.

If you need to catch a point on a map, using click listener is the most easies method (available in latest build):

Other solution (and bit more versatile) is to use a vector layer above your wms layer and put it into some drawing mode. This way you can e.g. select an area from the map instead of just point.


Hello Matti!

I hoped that you would chime in and there you are lightning fast :wink:

I’ll elaborate a little on my project… the plan is to display externally hosted WMS maps, shapefiles and metainformation. My current approach is to simply add WMSLayers which I identified in the xml file resulting from the getCapabilties request. This of course works but I’d prefer to add all externally hosted WMS Layers at once.

As the WMS are externally hosted tuning is not an option but I’ll look into the proxy server approach.

@MapClickEvent: Available in the
latest build
… that was the missing key :wink: thanks.

Thanks a lot, your help is greatly appreciated.

Regards, Stefan

The MapClickListener works like a charm… thanks again for the hint.

One additional question popped up: is it possible to determine which WMS Layer was clicked?

Thanks in advance,