1. A concise explanation of the problem you’re experiencing.
I need some help on how to properly use the KmlDataSource option, for example; where to store (host) my KML file. Can anyone help?
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
var viewer = new Cesium.Viewer(“cesiumContainer”);
var options = {
camera: viewer.scene.camera,
canvas: viewer.scene.canvas };
var kmllayer = viewer.dataSources.add(Cesium.KmlDataSource.load(’…kmls\2011_caribou.kmz’, options));
My kmls folder is currently in my site root
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I have 30 KML files that show a 3D heatmap with a predetermined style, each kml file represents a year. I have to find a way to animate the KML showing the change year by year in a web map. I found the CesiumJS and it seems like a viable option. Cesium ion works really well when I upload the data as a KMZ. It keeps the style and the correct height for each block, needless to say I’m pretty impressed with Cesium. However, do to licencing constraints I cannot use Cesium ion for the project. I want to use the KmlDataSource option in the CesiumJS library but I’m not sure what the best approach is for displaying my data. I’m very new to JavaScript and even newer to Cesium and I didnt really get a full grasp on how the KmlDataSource works.
4. The Cesium version you’re using, your operating system and browser.
Thanks for the kind words, and welcome to the Cesium community!
If you’re not using Cesium ion to host your KML files, you’ll need to host them on a web server. Either way, once you’re able to load the KML files into your CesiumJS scene, you’d have to write JavaScript code to detect when the year has changed in the timeline, and load the next KML file.
Is there anything particular about the Cesium ion licensing that prevents you from using it for your project? It would make this much easier, especially with upcoming tools we’re working on that’ll make it easier to drag and drop all those files and have them automatically appearing at specific time points.
Hello, how about visualizing geometry objects directly from a database like 3DcityDB without exporting or converting them? I’ve tried using a Flask API to connect the database with CesiumJS, but I don’t know how to retrieve the geometry from 3DcityDB and visualize it using CesiumJS. Can you help me please?
I don’t know if 3DcityDB is a database or not. I haven’t used the platform. Howerer, you can stream data into Cesium from a database hosted locally at least. I was able to use my CZML plugin to feed data into the Cesium viewer with a call like: