b4 Having issues getting WebMapServiceImageryProviderWorking


I just started working with cesium. So I’m sorry if this is answered elsewhere.
I’m using version b14

I started with ./Apps/Sandcastle/gallery/Minimalist.html and tried to add a WMS map source.

This is one example I tried with the provider:
var imageryProvider = new Cesium.WebMapServiceImageryProvider(
url : ‘http://vmap0.tiles.osgeo.org/wms/vmap0’,
layers : ‘basic,coastline_01,coastline_02,clabel,statelabel,ctylabel,rail,priroad,secroad,depthcontour,ferry,bridge,tunnel,cause’,
credit : ‘OSGEO’,
parameters : {
transparent : ‘false’,
format : ‘image/jpeg’
proxy : Cesium.FeatureDetection.supportsCrossOriginImagery() ? undefined
: new Cesium.DefaultProxy(’/proxy/’)

I get a blue ball. I do the images being requested and I can view them in firebug. They look reasonable.

In the console I see:

An error occurred in "WebMapServiceImageryProvider":
Failed to obtain image tile X: 3 Y: 2 Level: 2.

When I navigate, the error repeats for various combinations of the tiles.  All requests return data though.


Hi Glenn,

That sounds like a cross-origin problem. Unless you know that the WMS server includes CORS headers (most don’t), you need to always use the proxy. So change:

proxy : Cesium.FeatureDetection.supportsCrossOriginImagery() ? undefined
: new Cesium.DefaultProxy(’/proxy/’)


proxy : new Cesium.DefaultProxy(’/proxy/’)

You also need to add the WMS server host to the list of hosts allowed by the proxy, and then restart the web server. The list of allowed hosts is in build.xml.

Let me know if this is unclear or if you still have difficulties.


Thanks Kevin,

That worked for me. I’m currently trying to get a proxy working in ernest in a test app I’m developing. For development I run using the jetty 8.1.1 maven plugin. Their ProxyServlet is fighting me but I’m pretty sure I can get that to run. I may have to customize it.

Thanks again,

If you have control over the WMS server you’re using, the best thing by far is to enable CORS on it. It’s usually not very hard, and then you don’t need a proxy at all. Skipping the proxy is a performance win, too. More info on enabling CORS here: http://enable-cors.org/

Hi Kevin,

I'm having the same problem but cannot find the build.xml file - I'm using the b-26 build.



build.xml is part of the Cesium repo on GitHub, but it isn’t including in any of the release ZIP files. Instructions for syncing from GitHub and building Cesium are here: