CJ1
June 15, 2017, 1:07pm
1
I tried to add WMS Layer but it is not displaying. Here I give my server link and code. Please help
var viewer = new Cesium.Viewer(‘cesiumContainer’);
// Add a WMS imagery layer
var imageryLayers = viewer.imageryLayers;
imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
url : ‘http://34.211.24.18:1213/cgi-bin/ig?IEG_PROJECT=wgrid ’,
layers : ‘wgrid_5’,
parameters : {
transparent : true,
format : ‘image/png’
}
}));
abdou
June 16, 2017, 4:37am
2
you should try
new Cesium.WebMapServiceImageryProvider({
url : ‘http://34.211.24.18:1213/cgi-bin/ig ’,
layers : ‘wgrid_5’,
parameters : {
transparent : true,
format : ‘image/png’,
EG_PROJECT :‘wgrid ’
}
})
CJ1
June 16, 2017, 8:36am
3
Thanks farouk for your input.
I have tried with code given by you but still same problem. See both code has no error and wms tile is come properly form wms server. I checked and debugged. But some how this downloaded png image is not displaying on globe. Link of my WMS is avilabel live so any one can check. Please check why downloaded wms image is not displaying?
abdou
June 16, 2017, 3:46pm
4
Maybe you have a CORS issue (check in the forum).
CJ1
June 17, 2017, 10:16am
5
Yes you are right it was CORS problem.
I just added following line in my apache configuration file and restart my wms server.
<Directory “${SRVROOT}/cgi-bin”>
Header always set Access-Control-Allow-Origin “*”
Now my WMS services are displaying properly.
Thanks farouk