Open cesium viewer pointing at a kml / kmz file?

Is there any way to create a url pointing at the cesium viewer with a kml file link that will open automatically?

Something like

https://dl.dropboxusercontent.com/u/73681667/TheWarden/VIC/AWSNew/FWIChangeLive.kml Open = http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html

Can’t find a way to embed the viewer in to Google Sites so just want to use a link for now.

Thanks

Derek

I did this on my python Flask server using jinja 2 templating. I just pass the reference to the kml file as KMLFILE as a KmlDatSource.:

{% if KMLFILE %}

viewer.dataSources.add(Cesium.KmlDataSource.load(’{{KMLFILE}}’,options));

{% endif %}

Thanks Jesse but can’t host my own server for this one so just after a simple url solution

D

I don’t see the problem then. You should be able to add a KML Data Source using:

Thanks Jesse but can’t host my own server for this one so just after a simple url solution

D

I did this on my python Flask server using jinja 2 templating. I just pass the reference to the kml file as KMLFILE as a KmlDatSource.:

{% if KMLFILE %}

viewer.dataSources.add(Cesium.KmlDataSource.load(’{{KMLFILE}}’,options));

{% endif %}

Is there any way to create a url pointing at the cesium viewer with a kml file link that will open automatically?

Something like

https://dl.dropboxusercontent.com/u/73681667/TheWarden/VIC/AWSNew/FWIChangeLive.kml Open = http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html

Can’t find a way to embed the viewer in to Google Sites so just want to use a link for now.

Thanks

Derek

viewer.dataSources.add(Cesium.KmlDataSource.load(‘url’,options));

Mmm not sure if I have explained properly Jesse. This is what I am doing manually, but I just want to be able to do it with a single url I can send to someone to click on.

I currently click on this link to open the Cesium Viewer in Google Chrome

http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html

Then I drag and drop this .kml file into the viewer which displays it.

https://dl.dropboxusercontent.com/u/73681667/TheWarden/VIC/AWSNew/FWIChangeLive.kml

I would like to to be able to insert the kml link into the URL as an argument

http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html https://dl.dropboxusercontent.com/u/73681667/TheWarden/VIC/AWSNew/FWIChangeLive.kml

I have zero web development experience so have to keep it simple.

Thanks

Derek

CesiumViewer looks for a “source” query parameter and loads that automatically.

So …CesiumViewer/index.html?source=whatever

List of query parameter options is in the source:

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Apps/CesiumViewer/CesiumViewer.js#L33

Fantastic, just what I was looking for.

Thanks heaps Scott