# WMS / ArcGIS Server

**URL:** <https://community.cesium.com/t/wms-arcgis-server/2323>\
**Category:** CesiumJS\
**Created:** [April 9, 2015, 3:18pm UTC](https://community.cesium.com/t/wms-arcgis-server/2323 "2015-04-09T15:18:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tobias\_Brunner](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@Tobias\_Brunner](https://community.cesium.com/u/Tobias_Brunner)\
**Post date:** [April 9, 2015, 3:18pm UTC](https://community.cesium.com/t/wms-arcgis-server/2323/1 "2015-04-09T15:18:25Z")

</div>

When I try to access our ArcGIS Server through the "ArcGISMapServerImageryProvider", I get the following error:

An error occurred in "ArcGisMapServerImageryProvider": An error occurred while accessing [//www.gis.stadt-zuerich.ch/maps/services/wms/WMS-ZH-STZH-OGD/MapServer](https://www.gis.stadt-zuerich.ch/maps/services/wms/WMS-ZH-STZH-OGD/MapServer).

If I try the WMS interface using this config:  
&nbsp;&nbsp;&nbsp;&nbsp;addAdditionalLayerOption(  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;‘United States GOES Infrared’,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Cesium.WebMapServiceImageryProvider({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url : ‘[http://www.gis.stadt-zuerich.ch/maps/services/wms/WMS-ZH-STZH-OGD/MapServer/WMSServer?’](http://www.gis.stadt-zuerich.ch/maps/services/wms/WMS-ZH-STZH-OGD/MapServer/WMSServer?'),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;layers : ‘1’,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proxy : new Cesium.DefaultProxy(’/proxy/’)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}));

I Get  
An error occurred in "WebMapServiceImageryProvider": Failed to obtain image tile X: 1 Y: 0 Level: 1.

I can sucessfully get a WMS tile in the browser by typing in the following URL:  
[http://www.gis.stadt-zuerich.ch/maps/services/wms/WMS-ZH-STZH-OGD/MapServer/WMSServer?VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG:4326&Styles=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=FALSE&bbox=47.315492730374444,8.443821782566665,47.43963707749998,8.631776103472221&WIDTH=800&HEIGHT=800&Layers=Stadtplan](http://www.gis.stadt-zuerich.ch/maps/services/wms/WMS-ZH-STZH-OGD/MapServer/WMSServer?VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG:4326&Styles=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=FALSE&bbox=47.315492730374444,8.443821782566665,47.43963707749998,8.631776103472221&WIDTH=800&HEIGHT=800&Layers=Stadtplan)

what am I doing wrong? Im using the sandbox

> **[Cesium Sandcastle](https://sandcastle.cesium.com/index.html?src=Imagery%20Layers%20Manipulation.html&label=Showcases)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

Thanks!

---

<div class="post-metadata">

**Author:** ![Michele\_Andreolli](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Michele\_Andreolli](https://community.cesium.com/u/Michele_Andreolli)\
**Post date:** [April 9, 2015, 5:10pm UTC](https://community.cesium.com/t/wms-arcgis-server/2323/2 "2015-04-09T17:10:41Z")

</div>

The WebMapServiceImageryProvider works with the following code snippet:

addAdditionalLayerOption(  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;‘Zurich WMS’,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Cesium.WebMapServiceImageryProvider({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url : '[http://www.gis.stadt-zuerich.ch/maps/services/wms/WMS-ZH-STZH-OGD/MapServer/WMSServer?’](http://www.gis.stadt-zuerich.ch/maps/services/wms/WMS-ZH-STZH-OGD/MapServer/WMSServer?'),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;layers : ‘Stadtplan’,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parameters: {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;transparent: ‘true’,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;format: ‘image/png’,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;crs: ‘EPSG:4326’  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}));

For what concerns the ARCGIS service, are you sure to use the ARCGIS REST API?

> **[Imagery Layers Tutorial | cesium.com](https://cesium.com/blog/2013/01/04/cesium-imagery-layers-tutorial/)**
>
> We’ve moved the content of this tutorial to the new documentation section of the site, here.

Michele

---

<div class="post-metadata">

**Author:** ![Tobias\_Brunner](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@Tobias\_Brunner](https://community.cesium.com/u/Tobias_Brunner)\
**Post date:** [April 9, 2015, 7:50pm UTC](https://community.cesium.com/t/wms-arcgis-server/2323/3 "2015-04-09T19:50:26Z")

</div>

thanks for the snippet!

unfortunately, I still get

An error occurred in “WebMapServiceImageryProvider”: Failed to obtain image tile X: 0 Y: 0 Level: 0.

when I insert your snippet into the layers-manipulation example…

as for the AGS: yes, it’s the rest API

---

<div class="post-metadata">

**Author:** ![Michele\_Andreolli](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Michele\_Andreolli](https://community.cesium.com/u/Michele_Andreolli)\
**Post date:** [April 10, 2015, 7:11am UTC](https://community.cesium.com/t/wms-arcgis-server/2323/4 "2015-04-10T07:11:40Z")

</div>

If I set the proxy I get some errors and I don't visualize the map, but if I enable the Allow-Control-Allow-Origin: \* extension in the browser... it works well...no error logs

---

<div class="post-metadata">

**Author:** ![Tobias\_Brunner](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@Tobias\_Brunner](https://community.cesium.com/u/Tobias_Brunner)\
**Post date:** [April 10, 2015, 8:34am UTC](https://community.cesium.com/t/wms-arcgis-server/2323/5 "2015-04-10T08:34:07Z")

</div>

Thanks! This solved it for me - do I have to change anything on the AGS-Webserverside (CORS), so that the chrome extension is not needed anymore?

Thanks again!

---

<div class="post-metadata">

**Author:** ![Michele\_Andreolli](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Michele\_Andreolli](https://community.cesium.com/u/Michele_Andreolli)\
**Post date:** [April 10, 2015, 9:10am UTC](https://community.cesium.com/t/wms-arcgis-server/2323/6 "2015-04-10T09:10:35Z")

</div>

I'm not expert with AGS, but maybe this could help...

[https://developers.arcgis.com/javascript/jssamples/exp\_cors\_buffer.html](https://developers.arcgis.com/javascript/jssamples/exp_cors_buffer.html)
