How do I work with individual layers from an ArcGIS MapServer (with multiple layers)?

I'm accessing an ArcGIS mapserver in cesium using ArcGisMapServerImageryProvider.

The server has multiple layers that I would believe would normally be accessed using the esri api with setVisibleLayers. The layers can be viewed fine in an map.

If I access the root of the server (with cesium) at something like <//arcgis/rest/services/MapServer>, I can load all of the layers provided in one go, but I am unable to work with individual layers. I have tried accessing the layer URL directly, as well as the direct url to the json. (e.g. <arcgis/rest/services/MapServer/0> or <arcgis/rest/services/MapServer/0?f=pjson>).

In all cases trying to use an individual layer, I get a bad request error.

Any thoughts? Sorry if this is obvious. I'm pretty new to GIS stuff in general.


I just added support for individual MapServer layers to ArcGisMapServerImageryProvider in the “nm” branch on GitHub:

It has support for MapServer feature picking, too.

I’ll open a pull request to bring this into Cesium at some point.



I just wanted to let you know that the ability to use individual layers of an ArcGIS MapServer was added to Cesium 1.8, released last month.