Getting an “Error occurred while loading file…” message when trying to use the ‘source’ argument in the CesiumViewer url. Works fine with the dropbox link but the the same file hosted on DriveHQ gives an error for both the http and ftp file urls. File urls work fine in isolation but not as a ‘source=’ argument
First one works but other two give me an error
https://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html?source=https://dl.dropboxusercontent.com/s/dq01ur7jy9qef2f/doc.kml&view=116.4453,-31.4068,1146509,360,-90,0
https://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html?source=http://www.drivehq.com/file/df.aspx/publish/mingonn/HeadsUp/Radar/doc.kml&view=116.4453,-31.4068,1146509,360,-90,0
https://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html?source=ftp://ftp.drivehq.com/mingonn/HeadsUp/Radar/doc.kml&view=116.4453,-31.4068,1146509,360,-90,0
Using Windows10 and Chrome. In Explorer using the dropbox link works fine but the http url the viewer just hangs and the ftp url gives the same error
Hope someone can help out
Loading remote data requires the server to have proper CORS headers. https://enable-cors.org Sounds like Dropbox is correctly configured but the other service is not.
That’s frustrating because same http link works fine in GoogleEarth desktop in a NetworkLink, will contact the hosting company and see if they can do anything.
<?xml version="1.0" encoding="UTF-8"?>
0
1
1
0
0
http://www.drivehq.com/file/df.aspx/publish/mingonn/HeadsUp/Radar/doc.kml
onInterval
60
We checked it and noticed two issues:
(1) The first issue is very easy. Your script requires HTTPS based URLs. In your example links, you used HTTP and FTP based URLs. Please change to HTTPS based URLs.
(2) The second issue is indeed related with CORS headers. You don't need CORS headers to download files directly. In your case, your browser prevented Javascript from downloading files from another website without CORS headers. DriveHQ has added two HTTP headers in the response: Access-Control-Allow-Origin and Access-Control-Expose-Headers. The problem is solved now.