WebMapServiceImageryProvider not showing tiles

745 views
Skip to first unread message

tho...@gmail.com

unread,
Feb 7, 2014, 4:40:37 PM2/7/14
to cesiu...@googlegroups.com
Hello,

I downloaded the latest Cesium 2 days ago.

Using Chrome's element inspection tool (Network tab) I can see the tiles coming back from our geoserver, but the tiles are not displayed on the globe. Tried every which way to change settings, saying layers.raise(myLayer), myLayer.show(true). Nothing. The request to WMS looks good. SRS is 4326, everything looks normal from the network side.

I'd appreciate any insights. Here's my code:

var cesiumWidget = new Cesium.CesiumWidget('cesiumContainer');

var layers = cesiumWidget.centralBody.getImageryLayers();

var mountainLayer = layers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
url: 'http://foo:8080/geoserver/gwc/service/wms',
layers : 'mountain_areas',
parameters : {
format : 'image/png'
}

}));

Scott Hunter

unread,
Feb 7, 2014, 5:29:52 PM2/7/14
to cesiu...@googlegroups.com
The most common problem with loading imagery is a problem with cross-origin request headers, or CORS.  Check your requests for the Access-Control-Allow-Origin header, if it's not present, you can install CORS Filter in Geoserver.



--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

tho...@gmail.com

unread,
Feb 7, 2014, 6:08:30 PM2/7/14
to cesiu...@googlegroups.com
Hi Scott,

Thanks for your reply. The problem us not cross-origin. I can see the WMS images coming back in Chrome's debug window for Network traffic (see original post).
Thanks

Kevin Ring

unread,
Feb 8, 2014, 1:50:44 PM2/8/14
to cesiu...@googlegroups.com
Hi,

Unfortunately, seeing the requests and images coming back in Chrome's network tab doesn't prove there's no CORS problem, because a CORS failure results in the browser rejecting a request/response that was otherwise successful.  Unless the HTML page you're viewing is hosted on the same machine (and port!) as the GeoServer, or you've taken steps to ensure GeoServer is including CORS headers, then CORS is the most likely culprit.

If you're sure that's not the problem, my next step would be to turn on "stop on all exceptions" in the Chrome debugger and see if you're getting an exception somewhere.  Your code looks correct to me, so it's hard to imagine what (other than CORS failure) could be the problem.

Kevin

tho...@gmail.com

unread,
Feb 9, 2014, 9:57:52 AM2/9/14
to cesiu...@googlegroups.com, tho...@gmail.com

I see. I was thrown-off track by how Openlayers worked on this WMS, but not cesium. I will try a proxy servlet on my server (probably mush like your /proxy/ in the examples.

Thanks !

skirve...@qq.com

unread,
Nov 28, 2015, 2:38:44 AM11/28/15
to cesium-dev, tho...@gmail.com
hi,
Have you solved this problem?
I got the same problem.please goto my post 'https://groups.google.com/forum/#!topic/cesium-dev/QQ1iIhpkoBY' .
thank you.
Reply all
Reply to author
Forward
0 new messages