WCSTerrainProvider
WCSTerrainProvider copied to clipboard
Error in displaying data from geoserver wcs
I have following code
`
var viewer = new Cesium.Viewer('cesiumContainer');
var WCSTerrainProvider = new Cesium.WCSTerrainProvider({
service: "WCS",
url: "http://localhost:8080/geoserver/wcs",
layerName: "Test:5lowres",
bbox: [583397.6484945191, 2668855.23169113, 690818.106870519, 2855923.62310213],
waterMask: false
});
viewer.scene.terrainProvider = WCSTerrainProvider;`
Get following error on running the above code
cesium4.html:1 Failed to load http://localhost:8080/geoserver/wcs?SERVICE=WCS&VERSION=2.0.1&REQUEST=DescribeCoverage&CoverageId=Test:5lowres: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
Kindly help me in dealing with this error
Regards
Hi You should address this issue to the architect who has provided you the http server or the tomcat where geoserver is installed, in order to deactivate Cross control origin. Or refer to the tomcat/geoserver documentation.
Best regards
Le 6 oct. 2017 18:17, "sgeosol" [email protected] a écrit :
I have following html code
`
Cesium Demo `Get following error on running the above code
cesium4.html:1 Failed to load http://localhost:8080/ geoserver/wcs?SERVICE=WCS&VERSION=2.0.1&REQUEST= DescribeCoverage&CoverageId=Test:5lowres: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
Kindly help me in dealing with this error
Regards
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xlhomme/WCSTerrainProvider/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/ADzU5K1LbLlfmGwaFHvqnNOLqmjb6Qkvks5splKYgaJpZM4Pwt3T .
Thanks for the reply
I am running it in a Wamp server. My Apache version is 2.4.23. Can you please guide me in deactivating cross control origin ?
Thanks
Hi, I have resolved the CORS issue but still the globe is not displaying just the black background of cesium.
<script>
Cesium.BingMapsApi.defaultKey = "'{Key}'";
var viewer = new Cesium.Viewer('cesiumContainer', { animation: false, baseLayerPicker: false, fullscreenButton: false, vrButton: false, geocoder: false, homeButton: false, infoBox: false, sceneModePicker: false, selectionIndicator: false, timeline: false, navigationHelpButton: false, navigationInstructionsInitiallyVisible: false, scene3DOnly: false });
var WCSTerrainProvider = new Cesium.WCSTerrainProvider({
service: "WCS",
url: "http://localhost:8080/geoserver/wcs",
layerName: "Test:hiresdem",
waterMask: false
});
viewer.scene.terrainProvider = WCSTerrainProvider;
</script>
in console it displays
Invalid asm.js: Invalid member of stdlib WCSTerrainProvider.js:546 DTM Level 0 0 0 1.7780518301560386 1.7780310946455147 WCSTerrainProvider.js:546 DTM Level 1 0 0 3.5561036603120773 3.5560621892910294 WCSTerrainProvider.js:546 DTM Level 2 0 0 7.1122073206241545 7.112124378582059 . . .
Kindly help me.