Using the Web Map Service (WMS) Sandcastle demonstration, I have plugged in an alternative url, layers, format. From the beginning, the console is reporting ‘An error occurred in “WebMapServiceImageryProvider”: Failed to obtain image tile X: 0 Y: 0 Level: 0.’
I’ve tested the identical URL in Google Earth, and it works just fine, so I am skeptical that it may be CORS, however I do not operate the originating server and do not know its CORS configuration.
It is most likely a CORS issue. If you bring up the developer tools console you should see additional errors confirming this (unfortunately not all errors are able to be shown in the Sandcastle console).
Since Google Earth is a native application, it exists outside of browser sandboxing and is not restricted by CORS.
If you still think it’s not a CORS issue, can you share the URL and Cesium code you are using to configure it?
Thanks for your prompt reply and the reminder that GE is not a suitable comparison. I am waiting to hear from the server owner concerning CORS; depending upon the outcome, I will post the additional details here.
First, CORS was the root of the original problem, and this proved to be the ultimate remedy. However, now that I am getting data displayed, I have discovered some unexpected behavior that appears to be tiling the WMS overlay within the rectangle, in a way the varies with zoom. Allow me to demonstrate with the following two cases. (The hyperlink will illustrate the expected appearance of the overlay; the code, swapped into the Sandcastle, will generate the unexpected results.)
The exception is the famous "CORS No Access-Control-Allow-Origin".
If I add the proxy line (proxy: new Cesium.DefaultProxy('/proxy/')), I have a new exception like Error 400, Bad Request.
I tried this WMS service in other visor with a successful result, approximately in BBOX (-19, 45, 12, 33).
Could anyone help me?
Thank you very much for your replies!!
The server hosting the tiles needs to have CORS enabled. If you have control of the server, you can learn about enabling CORS here: http://enable-cors.org/
Otherwise, I’m not sure if there is a workaround. CORS is disabled by default for server security.
Hello!,
Hannah! Thank you very much for you reply.
I don't understand if it's a CORS problem in the hosting side, why is working in other visors, like this one?: http://www.idee.es/visualizador/