[GIS] Allowing cross-domain access of third-party WMS server from OpenLayers

openlayers-2wms

I have a web site with an OpenLayers client. I also have a GeoServer running on the same domain. My OpenLayers uses services like WMS, GML, etc. from this GeoServer installation and everything runs fine.

Now, I want to add another WMS layer to my existing set of layers. This layer is provided by a third-party WMS (not owned by me). How can I add this layer to my OpenLayers by bypassing the cross-domain issue.

PS: I am aware that GeoServer allows adding third-party WMS as a new data store and lets me publish the available layers, but I am facing some projection issues there which I will be asking in a different question.

Best Answer

You only need a proxy if you are looking to do WFS or WMS GetFeatureInfo requests. Basic WMS requests should work out of the box in OpenLayers (or any other client).