I had tried adding a WMS layer from geoserver to cesium globes by below code
var widget = new Cesium.CesiumWidget('cesiumContainer');
var url='http://localhost:8080/geoserver/wms'; //Geoserver URL
var layers = widget.scene.globe.imageryLayers;
layers.removeAll();
layers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
url : url,
layers: 'Vishakapatnam:Vishakapatnam_Imagery'
}));
The WMS layer is not getting added in the globe. Even i tried adding cors filter in /etc/tomcat7/web.xml. But no luck.
Open your web browser console window. What errors are you getting?
Am getting the below error in console
An error occurred in “p”: Failed to obtain image tile X: 10 Y: 3 Level: 3.
Cesium.js:429 An error occurred in “p”: Failed to obtain image tile X: 11 Y: 2 Level: 3.
Cesium.js:429 An error occurred in “p”: Failed to obtain image tile X: 10 Y: 2 Level: 3.
Ok. If you go to the “Network” tab in the Developer Tools you should be able to see the requests that are being sent to geoserver. What are the responses from geoserver?
I saw the responses. There were no responses from geoserver. But in the console i can see this
http://localhost:8383/proxy/?http%3A%2F%2Flocalhost%3A8080%2Fgeoserver%2Fwm…PSG%3A4326%26bbox%3D-45%2C45%2C0%2C90%26width%3D256%26height%3D256 Failed to load resource: net::ERR_EMPTY_RESPONSE
Cesium.js:429 An error occurred in “p”: Failed to obtain image tile X: 2 Y: 1 Level: 2.
Cesium.js:429 An error occurred in “p”: Failed to obtain image tile X: 3 Y: 0 Level: 2.
Look for the network requests that are targeting localhost:8383/proxy. Something is probably misconfigured on your proxy. Aside from this, if you properly enabled CORS on tomcat, you don’t need to use a proxy.
Is there any good documentation for enabling CORS on tomcat.? I use Tomcat7 in Ubuntu 15.04.
abdou
April 24, 2016, 7:35am
8
I tried configuring the CORS filter in my tomcat installed in Ubuntu in /etc/tomcat7/web.xml by adding the below lines
I had tried adding a WMS layer from geoserver to cesium globes by below code which is in snapshot
But no luck after adding CORS filter also. You could see my response from developer tools
abdou
April 25, 2016, 4:27pm
10
Hello,
I don't understand, why do you use a proxy? In your code there is no proxy and your network reports an URL with a proxy (port 8383).
Could you details your architecture and could you send your WMS capabilitues document?
zukliu
May 31, 2019, 3:21pm
11
when I access geoserver from cesium, need help
An error occurred in "UrlTemplateImageryProvider": Unable to find expected tilesets or bbox attributes in http://47.100.125.118:8080/geoserver/map/wms/tilemapresource.xml .
Help us help you.
Please show the code you are using to access the WMS. Can you attach the tilemapresource.xml file? What version of Cesium are you using?
Scott