WMS overlay in the cesium globe


I am overlaying WMS layer using the function ‘WebMapServiceImageryProvider’. When the layer is served from the local servers it is fetching the data via proxy. However, when i am trying to overlay any layer from an external server, the proxy is returning empty value. And if i remove the proxy, the images are fetched but they do not appear on the globe.

Following is the code snippet i am using -

var layer1= new Cesium.WebMapServiceImageryProvider({

url : url1,

layers: layername// Here just give layer name

//,proxy : new Cesium.DefaultProxy(‘proxy.php’)



Please help.


To use the proxy, you probably need to add url1 to your proxy’s whitelist. Is proxy.php your own proxy server? For the Java-based proxy included in the Cesium GitHub repo, the whitelist is specified in build.xml. Search for runServer.allowedHosts.

Better yet, avoid using the proxy entirely by making sure your WMS server supports CORS. This is easy to do for most WMS servers, as long as you have the necessary access to make changes to its configuration.

Unfortunately, without CORS and without a properly-configured proxy, WebGL-based applications like Cesium are forbidden by browser rules from rendering images downloaded from a remote server. That’s why you’re seeing the images fetched successfully, but then they don’t show up.



Proxy.php is a curl based php script for setting proxy. I will look in to the java-based proxy provided by cesium. and also the CORS support.

I enabled CORS support (to an internal webserver), it works without proxy now. Thanks, the problem is resolved.