dynamically update images loaded from KML

**Afternoon all, **

firstly thank you to the Cesium devs for this wonderful tool :smiley:

Now, onto my question…

I am currently using a .kml file to view static webcam images from around the globe, I have edited these so that the icon displayed is a snapshot of the webcam in question.

is there anyway to get this image to refresh so that we have the latest image from the server shown?

Hi Tommy,

Glad you think so, thanks! :grinning:

I assume you are using a billboard to show the icon. You can update the html canvas of the billboard as needed, there is a good thread on that here.

Thanks,

Gabby

Ok, I’ve taken a look at the suggested thread and it is far beyond my comprehension level!

allow me to share the code I am using and see if there is anything that will help in that.

This is the code inside my main page source which calls the .kml

/////////////////////// colima webcam test ///////////////////////

var colima;
var colimaPromise = Cesium.KmlDataSource.load(’./Source/kml/colimarefresh.kml’, kmlOptions);

colimaPromise.then(function(dataSource) {

viewer.dataSources.add(dataSource);
colima = dataSource.entities;
colima.show = true;});

``

the .kml (generated in GEarth):

<?xml version="1.0" encoding="UTF-8"?> colimarefresh.kml 2 https://cors-anywhere.herokuapp.com/http://webcamsdemexico.net/colima1/live.jpg onInterval30 0 0.0 20 https://cors-anywhere.herokuapp.com/http://webcamsdemexico.net/colima1/live.jpg onInterval30 normal #sn_live highlight #sh_live Colima Laguna de Carrizalillo <![CDATA[

Colima - Mexico

Refresh rate: 15 s
Location: 12 km SSW in Colima at Laguna de Carrizalillo
View: S flank]]> -103.6588149941341 19.42146953644629 0 -1.418000027619482 7.68680500281646 7614.798585368862 relativeToSeaFloor #msn_live 1 -103.6741945874884,19.41302910117406,0

``

The website that hosts the webcams updates the images in the .jpg every 15 seconds,I would like to be able to reload the icon (Billboard?) image loaded into Cesium so that the displayed picture is kept up to date.

This is part of a larger project that will (hopefully) feature webcams from around the world and display them as close to real time as possible.

thanks for any advice

Tom