and help me out with building a Cesium.WebMapServiceImageryProvider?
I have:
var spot = new Cesium.WebMapServiceImageryProvider({
url: ‘http://wms.alaskamapped.org/ortho’,
layers: 'ORTHO.RGB, //tried a bunch of different names out here
});
I am seeing a CORS error when the page loads, but I have seen those before when the problem ultimately was a poorly constructed url or parameter. I think I need to rule out the possibility that I am not referencing the layer properly.
CORS issues usually have to do with how your server is configured. http://enable-cors.org/ is a good resource for learning about CORS and how to enable it.
I was able to get your imagery to load with the code you included in your post, so that’s not the problem.
You most likely have to enable CORS support on your own server. For example, we have a proxy route included in the server.js node script included with the Cesium download. If you run Sandcastle locally by doing node server.js, this code will work:
var viewer = new Cesium.Viewer(‘cesiumContainer’, {
imageryProvider : new Cesium.WebMapServiceImageryProvider({
url: ‘//wms.alaskamapped.org/ortho’,
layers: ‘ORTHO.RGB’,
proxy : new Cesium.DefaultProxy(’/proxy/’)
}),
baseLayerPicker : false
});
``
For the TMS server, consider using the UrlTemplateImageryProvider instead, since you know the template of the URL: