Accessing a WMS layer from geoserver and adding it in cesium globe

1,454 views
Skip to first unread message

Farook M

unread,
Apr 21, 2016, 3:52:36 AM4/21/16
to cesium-dev

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.


Piero Toffanin

unread,
Apr 21, 2016, 11:22:31 AM4/21/16
to cesium-dev
Open your web browser console window. What errors are you getting?

Farook M

unread,
Apr 21, 2016, 12:16:40 PM4/21/16
to cesium-dev
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.

Piero Toffanin

unread,
Apr 21, 2016, 4:09:33 PM4/21/16
to cesium-dev
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?

Farook M

unread,
Apr 22, 2016, 1:29:39 AM4/22/16
to cesium-dev
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%253A4326%26bbox%3D-45%252C45%252C0%252C90%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.

On Thursday, 21 April 2016 13:22:36 UTC+5:30, Farook M wrote:

Piero Toffanin

unread,
Apr 22, 2016, 11:34:27 AM4/22/16
to cesium-dev
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.

Farook M

unread,
Apr 23, 2016, 9:05:08 AM4/23/16
to cesium-dev
Is there any good documentation for enabling CORS on tomcat.? I use Tomcat7 in Ubuntu 15.04.


On Thursday, 21 April 2016 13:22:36 UTC+5:30, Farook M wrote:

bobac...@gmail.com

unread,
Apr 24, 2016, 3:35:21 AM4/24/16
to cesium-dev
Le samedi 23 avril 2016 15:05:08 UTC+2, Farook M a écrit :
> Is there any good documentation for enabling CORS on tomcat.? I use Tomcat7 in Ubuntu 15.04.
>
> On Thursday, 21 April 2016 13:22:36 UTC+5:30, Farook M wrote:
>
>
> I had tried adding a WMS layer from geoserver to cesium globes by below codevar 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.

Hello, you should see http://enable-cors.org/

Farook M

unread,
Apr 25, 2016, 1:31:04 AM4/25/16
to cesium-dev

I tried configuring the CORS filter in my tomcat installed in Ubuntu in /etc/tomcat7/web.xml by adding the below lines

On Thursday, 21 April 2016 13:22:36 UTC+5:30, Farook M wrote:

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

bobac...@gmail.com

unread,
Apr 25, 2016, 12:27:08 PM4/25/16
to cesium-dev
Le lundi 25 avril 2016 07:31:04 UTC+2, Farook M a écrit :
> I tried configuring the CORS filter in my tomcat installed in Ubuntu in /etc/tomcat7/web.xml by adding the below lines
>
> On Thursday, 21 April 2016 13:22:36 UTC+5:30, Farook M wrote:
>
>
> 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
>
>
>
>
> 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.

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?

zuk...@ebay.com

unread,
May 31, 2019, 11:21:26 AM5/31/19
to cesium-dev
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.

Scott Reynolds

unread,
Jun 1, 2019, 3:15:57 PM6/1/19
to cesium-dev
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
Reply all
Reply to author
Forward
0 new messages