Load multiple KMLs simultaneously

25 views
Skip to first unread message

neamtu....@gmail.com

unread,
Aug 26, 2019, 1:53:11 PM8/26/19
to cesium-dev
1. A concise explanation of the problem you're experiencing.

Hello, I need to load multiple KMLs at the same time. Is this possible?

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

viewer.dataSources.add(Cesium.KmlDataSource.load('myFile.kml', options));

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I need to load multiple KMLs at the same time.

4. The Cesium version you're using, your operating system and browser.

CesiumJS 1.60
Windows 7
Mozilla Firefox 68.0.2

Omar Shehata

unread,
Aug 26, 2019, 2:15:09 PM8/26/19
to cesium-dev
You would just repeat that same line of code for each file you have. Did you run into any issues doing that?
Message has been deleted

neamtu....@gmail.com

unread,
Aug 26, 2019, 3:37:24 PM8/26/19
to cesium-dev
I am now able to keep multiple KMLs loaded at the same time by removing this line:

viewer.dataSources.removeAll();

Is there any method to remove a single KML, and not all? Thanks in advance.

Omar Shehata

unread,
Aug 26, 2019, 4:10:46 PM8/26/19
to cesium-dev
You can use the remove method, which you can read about in the docs here:


The docs are a good source for finding what all the methods that are available on a particular class in CesiumJS are.

neamtu....@gmail.com

unread,
Aug 28, 2019, 5:53:08 PM8/28/19
to cesium-dev
Thank you. I read the documentation and was able to fix the problem!
Reply all
Reply to author
Forward
0 new messages