Data gathered from Cesium through KML polling

I have an application where KML data is continuously generated and updated every second. Currently, I am displaying this data on a Cesium map using the following code:

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.KmlDataSource.load('link to live data stream'));

While this setup works well for the initial data display, it does not update dynamically with new information. What would be the most efficient approach to refresh the KML data in Cesium every one or two seconds to ensure that the map reflects real-time changes?

Thank you!

Answer №1

Starting from Cesium version 1.19 (2016-03), the KML Data Source now fully supports NetworkLinks with refreshMode=onInterval. This means that when the designated interval is reached, the KML data source will automatically update within Cesium. If the KML file can auto-update in Google Earth, it should seamlessly do so in Cesium as well.

Given that Cesium operates as a web-based application, it's essential to consider cross-domain requests. If the KML URL is hosted on a different server than the one hosting the Cesium HTML pages, ensure that the service for the KML includes the Access-Control-Allow-Origin property in the HTTP headers of the response. Failure to do so may result in loading issues.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is the MVC pattern adhered to by ExpressJS?

Currently, I am diving into the world of creating an MVC Website With ExpressJS using resources from I'm curious to know if ExpressJS strictly adheres to the MVC pattern, or if it follows a different approach like Flask which focuses more on the "C" ...

What is the best way to retrieve the response from an Ajax request?

I attempted to use this code snippet : var xhttp = new XMLHttpRequest(); function activateComment(commentID, linkID) { var data = "id="+encodeURIComponent(commentID); var endpoint = 'comments_handler.php'; xhttp.open("POST", endpoi ...

Detect mouse events using electron even when the window is not in focus

Is there a way to detect mouse events such as hover and click even when the Electron window is not the active focus? I want to ensure that my buttons' hover and click effects still function properly. Currently, I find that I have to switch back to th ...

Starting the download of the canvas featuring a stylish border design

I'm facing an issue where the canvas border is not showing up when I download the canvas with a border. The border appears on the screen, but it doesn't get included in the downloaded canvas. let canvas=qrRef.current.querySelector("canvas&qu ...

`Express.js Controllers: The Key to Context Binding`

I'm currently working on a project in Express.js that involves a UserController class with methods like getAllUsers and findUserById. When using these methods in my User router, I have to bind each method when creating an instance of the UserControlle ...

Calculating the surface area of a two-dimensional flat shape within a three-dimensional space using Javascript and Math

Is it possible to calculate the surface area of a 2D polygon with any shape, using a set of 3D vertices? For instance, what would be the surface area of the given figure? var polygon = new Polygon([new Point(0,0,0), new Point(5,8,2), new Point(11,15,7)]) ...

Need help addressing a sliding page issue in my Upwork clone script using JavaScript

For those familiar with Upwork's UI, you may have noticed a small feature I implemented. When a user clicks on a freelance job offer, another page opens from the left side using transform: translate(120%) to transform: translate(0). The issue arises ...

I attempted to include multiple images in my HTML using Vue.js, but encountered an error message stating "illegal invocation"

Here is my HTML code: <form method="POST" v-on:submit.prevent="handleSubmit($event);"> <div class="row"> <div class="col-md-4"> <div class="form-group label-floating"> <label class="control-label">Name</label> <input ...

Enhance filtering capabilities in ng-repeat by adding controls

After utilizing ng-repeat to display some JSON data, I have incorporated form controls to filter output data from another JSON file. Here is a simplified example: First JSON data: var technologies = [ {"id":"5", "slug":"mysql", "label":"MyS ...

Making Jquery functions work with Internet Explorer (including toggle and animate)

Why is this jQuery code snippet not functioning as expected in Internet Explorer? It works flawlessly across all Webkit browsers. $('#logo').toggle(function() { $('#about').animate({'top': '-400px'},'slow&a ...

Error in TypeScript: Typography type does not accept 'string' type as valid

As I attempt to implement the Typography component from material-ui using TypeScript, I encounter a perplexing error message TypeScript is throwing an error: Type 'string' is not assignable to type 'ComponentClass<HTMLAttributes<HTMLE ...

Value retention issue observed in AngularJS object within controller method

As a junior developer, I may be overlooking something obvious, but I'm really struggling with my Angular webapp. I'm trying to load a hash-dictionary that maps environment names to arrays of hosts, like {development: ["dev.8090", "host.dev.9009"] ...

What is the best way to vertically center a button against a video using CSS?

How can I vertically center a button against a video using CSS? Here is my code: https://jsbin.com/curefoyefe/edit?html,css,js,output <video controls="" ng-show="myForm_live_video.live_video.$valid" ngf-src="live_video" width="200" height="200" class= ...

Issues with AngularJS routing functionality are causing it to malfunction

Having Trouble with My Angular Routing Function - Page Loads Without 'home.html' Here is the code I am using: Index.html <html ng-app="App" class="no-js" lang="en" > <head> <script src="https://ajax.googleapis.com/ajax/libs ...

Modify an HTML tag attribute on a webpage with jQuery

I'm attempting to understand the process of developing a basic Chrome extension that modifies a certain tag's property on a webpage. The website contains the following code snippet: <body ondragstart="return false;" onselectstart="return fal ...

Performing authentication in a REST JSON GET request using Swift

As a newcomer to Swift, I am also venturing into the world of JSON and REST for the first time. My goal is to verify user credentials, ensure their validity, and then display some JSON data on the screen. However, most resources I've come across seem ...

Access the URL with personalized request headers

Our team manages a collection of primary web pages that cater to various organizations. These pages undergo changes in appearance (fonts, images, etc.) depending on the organization accessing them. This customization is done through a unique HTTP Request H ...

Developing personalized JavaScript utilizing live data sources

Trying to implement ecommerce events on our website using GTM has been a bit challenging for me. I have attempted to create a custom value with custom JavaScript, but unfortunately, it keeps showing as undefined. In the initial stages, I came across a dat ...

Angularjs Dependency Module Aggregation

Just diving into angularjs, I have a question. Can I include multiple dependency modules in AngularJS? sample code: angular.module('myApp', ['dependency1','dependency2']); I attempted this approach as well without success ...

What is the reason behind react-router-dom not supplying location.key during the initial page load?

In my component screen using react-router, I heavily rely on the parameter location.key to identify paths and other elements (using location.pathname did not resolve the issue). However, I noticed that when I first load my app, react-router does not have ...