Move airplane without refreshing manually

Hi @Tony ,

Thanks for your post and for being part of the Cesium community.

It looks like in your app you are trying to pass the location, altitude, heading, etc information from the backend server build with Flask to the front end HTML page that is running your scene in CesiumJS, and using templates to pass in the data values. Since your Flask server is using a REST architecture, this means the backend data is only fetched when you call the “/” route, which happens when you load or refresh the page.

You have a few options.

  • You could have your “/” route load the frontend page (when you load or refresh) and create a separate route that you call at a frequent interval to fetch the location, altitude, heading info and update the Cesium scene. Javascript setInterval works for this purpose, where you specify code you want to run each cycle. Here is an example, Model movement, dynamic positions from server, basically you want to call your new data endpoint each cycle, and update the entity in your scene the same way you are doing now.

  • if you know what the location, altitude, heading will be at each timestep before hand, you could upload this information to a SampledPositionProperty like in this example Cesium Sandcastle

I hope these examples are useful as you work towards your desired behavior. Please let us know if we can be of further help.

Thanks,
Luke