var imageProvider = new Cesium.UrlTemplateImageryProvider({
url: ‘http://gis.apfo.usda.gov/arcgis/rest/services/NAIP/Alabama_2015_1m/ImageServer/exportImage?bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&bboxSR=&size=&imageSR=&time=&format=jpgpng&pixelType=U8&noData=&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_BilinearInterpolation&compression=&compressionQuality=&bandIds=&mosaicRule=&renderingRule=&f=image’
});
var imageLayer = new Cesium.ImageryLayer(imageProvider);
c.scene.imageryLayers.add(imageLayer);
I appreciate any help!
Thanks,
Peter
Hello,
I have seen that “UrlTemplateImageryProvider” is to be used in order to pull in imagery from ArcGIS ImageServers, but I am having difficulty understanding how to implement it.
There was a previous post here, where someone loosely described how to import it, but: I couldn’t understand their explanation, nor could I get their code to work in Sandcastle.
This was his code:
var c = new Cesium.Viewer(‘cesiumContainer’);
Hi Peter,
UrlTemplateImageryProvider allows you to use any imagery server, so long as you tell the API where required meta-information should be included in the url string. As a simplified example, if had a tile server that gave me tile 0/0/0 with the url https://tileserver.com/0/0/0, the url template would be https://tileserver.com/{x}/{y}/{z}.
In actuality, a feel more parameters are required, which you can read about here: http://cesiumjs.org/Cesium/Build/Documentation/UrlTemplateImageryProvider.html?classFilter=url
The example from the thread you linked to worked for me. See it again here: http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=b43e816e932a4ecd01fcce75978f0c50
Side note: in the future, you can share code more easily by creating a code example in Sandcastle then clicking the “Share” button up top to save your code as a gist then generate a link to the saved code in Sandcastle. You can read more about Sandcastle tips (there are a lot of really useful ones!) here: http://cesiumjs.org/tutorials/Sandcastle-Tutorial/
Hope that helps,