Cesium in 2015 - KML

Since KML is a large specification, we would love to hear what parts of it are most important to you in order to help shape the roadmap. We're also looking for some kickass offline free-to-distribute KML examples that we can include for our Sandcastle demo.

Loading https://bitbucket.org/sbarbot/sceq/raw/default/sceq.kml results in multiple errors and eventually a crash. It would be good test case.

The sample code is

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.KmlDataSource.load('https://bitbucket.org/sbarbot/sceq/raw/default/sceq.kml’),
     {
         camera: viewer.scene.camera,
         canvas: viewer.scene.canvas
     });

Hello,

It looks like this is a CORS issue. If you look in the console, it says “XMLHttpRequest cannot load https://bitbucket.org/sbarbot/sceq/raw/default/sceq.kml. No ‘Access-Control-Allow-Origin’ header is present on the requested resource.”

I’m guessing bitbucket doesn’t allow CORS (cross-origin resource sharing)

Are you able to serve the data from your own server? If it is being retrieved by an app running on the same domain, you shouldn’t have this same CORS problem.

Best,

Hannah

Hi Hannah,

Some of the elements of the kml file are being loaded. I conclude that not all types of kml objects are supported. But it’s only a guess. It could be a CORS problem, but I don’t think bitbucket is the problem because the file can be read from Google Earth.

Thanks,

Sylvain

Hi Sylvain,

I don’t think Google Earth has the same CORS restrictions that you see when trying to load a file from a web application. Do you see any error messages in the console when you try to load the file? It could be objects we don’t yet support, but I didn’t see anything like that when I quick took a look at the file.

Best,

Hannah

Hi Hannah,

I don't see an error message, but the application crashes. Before
that, I do see some features in the Network Link (some simple icons),
but most of the other stuff is out. You can find the material I'm
trying to display here

Or simply by

hg clone ssh://hg@bitbucket.org/sbarbot/sceq

Thanks,
Sylvain

Hey Cesium team! Is KML development still pushing forward? What’s next on the list to address? Thanks!

Hello,

Cesium does have KML support now. You can see an example here: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=KML.html&label=DataSources

We have an issue listing features that are still on our to-do list here: https://github.com/AnalyticalGraphicsInc/cesium/issues/873

Best,

Hannah

Hi Hannah,

The code

var viewer = new Cesium.Viewer(‘cesiumContainer’);
viewer.dataSources.add(Cesium.KmlDataSource.load(‘https://bitbucket.org/sbarbot/sceq/raw/default/sceq.kml’),
     {
         camera: viewer.scene.camera,
         canvas: viewer.scene.canvas
     });

still does not seem to work.

I get

KML - Unsupported feature: ScreenOverlay KML - Unsupported StyleMap
key: highlight KML - Unsupported StyleMap key: highlight Request has
failed. Status Code: 404

Perhaps there is still an issue with network links.

Thank you,
Sylvain