# Problem with WebMapServiceImageryProvider

**URL:** <https://community.cesium.com/t/problem-with-webmapserviceimageryprovider/2066>\
**Category:** CesiumJS\
**Created:** [February 26, 2015, 8:13am UTC](https://community.cesium.com/t/problem-with-webmapserviceimageryprovider/2066 "2015-02-26T08:13:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.ermolaev.dev](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@a.ermolaev.dev](https://community.cesium.com/u/a.ermolaev.dev)\
**Post date:** [February 26, 2015, 8:13am UTC](https://community.cesium.com/t/problem-with-webmapserviceimageryprovider/2066/1 "2015-02-26T08:13:40Z")

</div>

I have to add the weather data layer. I try to connect to openweathermap service(description is here: [http://openweathermap.org/hugemaps#wms](http://openweathermap.org/hugemaps#wms)).

&nbsp;&nbsp;var viewer = new Cesium.Viewer('cesiumContainer', {  
&nbsp;&nbsp;baseLayerPicker: false,  
&nbsp;&nbsp;homeButton: false,  
&nbsp;&nbsp;infoBox: false,  
&nbsp;&nbsp;imageryProviderViewModels: false  
&nbsp;&nbsp;});

&nbsp;&nbsp;var imageryLayers = viewer.imageryLayers;  
&nbsp;&nbsp;imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({  
&nbsp;&nbsp;&nbsp;&nbsp;url: ‘[http://wms.openweathermap.org/service](http://wms.openweathermap.org/service)’,  
&nbsp;&nbsp;&nbsp;&nbsp;layers: ‘pressure’,  
&nbsp;&nbsp;&nbsp;&nbsp;parameters: {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;transparent: false,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;format: ‘image/jpeg’,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;APPID: ‘here my code’  
&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;}));

This code does not work. Tiles are not drawn, but loaded. In console I have the next errors: An error occurred in "N": Failed to obtain image tile X: 0 Y: 0 Level: 0. etc.

What could be the problem?

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [March 5, 2015, 7:30pm UTC](https://community.cesium.com/t/problem-with-webmapserviceimageryprovider/2066/2 "2015-03-05T19:30:48Z")

</div>

If you look in the browser console, you’ll see it’s complaining that [openweathermap.org](http://openweathermap.org) does not support CORS (cross-origin resource sharing). This means you need to use a proxy. The Cesium dev server ships with one, which I’ve added to your code below. In a production application, you would configure your server to have it’s own proxy.

```
    imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
            url: '[http://wms.openweathermap.org/service](http://wms.openweathermap.org/service)',

```

proxy: new Cesium.DefaultProxy(’/proxy/’),  
layers: ‘pressure’,  
parameters: {  
transparent: false,  
format: ‘image/jpeg’,  
APPID: ‘here my code’  
}  
}));

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [March 5, 2015, 7:31pm UTC](https://community.cesium.com/t/problem-with-webmapserviceimageryprovider/2066/3 "2015-03-05T19:31:41Z")

</div>

There’s more information on proxying in our imagery tutorial: [http://cesiumjs.org/2013/01/04/Cesium-Imagery-Layers-Tutorial/](http://cesiumjs.org/2013/01/04/Cesium-Imagery-Layers-Tutorial/)
