Automatically triggering the "Today(Real Time)" button left above the cesium clock widget.

1. A concise explanation of the problem you’re experiencing.

I can’t trigger/click the button left above the cesium clock widget from javascript. I don’t want the usser to click it manually from the mouse but actually I want to trigger it as soon as the cesium application is loaded.

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

I was a code similar to this would work.

$(".cesium-viewer-animationContainer g.cesium-animation-rectButton").click(); I am retrieving the element and trying to fire the click event.

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

I need this so that when the user opens the cesium web application the clock will automatically move to current time rather than waiting for the user to click it.

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

I think this is irrelevant anyway, Chrome and OS is ubuntu.

You can just force the clock to be in “real-time” mode. The button will follow the state of the clock.

viewer.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK;

Thanks. I also have another question. How do I create dynamic polylines in czml without references. I can’t use references because my polyline is not straight. It is curved and I am trying to use this polyline to display the sun’s terminator line. Here is the code for sun’s terminator. Here is my packet for the polyline :
{

“id”: “penumbra”,

“name”: “sunlight/penumbra”,

“polyline”: {

   "positions": {

               "cartesian":[-436949.94215134426,-5540242.744862489,3119269.5339601585,

   				808254.6668188444,-5491860.58486007,-3130618.3153370647,

   				1213772.7958770148,47129.20057363719,-6240409.581929305,

   				379979.76474798686,5537998.16435109,-3130618.3153370703,

   				-865227.3645574505,5489680.913456493,3119269.5339601524,

   				-1270617.376824445,-49336.40085534793,6229142.922290903]

    },

   "width": 1,

   "material":{

   	"solidColor" : {

   		"color":{

   			"rgba" : [223,145,123,233]

   		}

   	}

   },

  	"show": true,

   "loop": true

 }

}

Now what I want to do is change the cartesian property with time. I could do it if it had only three numbers for each co-ordinate but as you can see it is an array so I don’t know the workaround to it.

Hello,

You can use several “interval” properties to change the position over time. See the CZML Structure Guide on Intervals for a more in-depth explaination: https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Structure#intervals

Also see this Sandcastle example on how to use intervals: https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=CZML%20Polygon%20-%20Intervals,%20Availability.html&label=All

Thanks,

Gabby

Thanks a lot for your help. Is there I managed to implement them using intervals but the interpolation for moving the lines uniformly is not working for some reason. Could you please help me with that?
Here is my code so far for that particular packet.

{

“id”: “penumbra”,

“name”: “sunlight/penumbra”,

“polyline”: {

   "positions":[

   		{

   			"interval":"2017-08-23T18:56:20T/2017-08-23T18:56:22T",

   			"cartesian":[-426949.94215134426,-7640242.744862489,5219269.5339601585,-446949.94215134426,-6540242.744862489,6119269.5339601585,886983.8188979052,-701371.5528624209,-6241158.163957005,3680046.411423023,4155567.993615343,-3130986.5612151613,2667443.2900212044,4875184.890210869,3119672.894708141,-1033361.8986951738,734328.7961559445,6229926.385185096	]

   		},

   		{

   			"interval":"2017-08-23T18:56:22T/2017-08-23T18:56:24T",

   			"cartesian":[-536949.94215134426,-7640242.744862489,5219269.5339601585,-446949.94215134426,-6540242.744862489,6119269.5339601585,886983.8188979052,-701371.5528624209,-6241158.163957005,3680046.411423023,4155567.993615343,-3130986.5612151613,2667443.2900212044,4875184.890210869,3119672.894708141,-1033361.8986951738,734328.7961559445,6229926.385185096	]

   		},

   		{

   			"interval":"2017-08-23T18:56:24T/2017-08-23T18:56:26T",

   			"cartesian":[-646949.94215134426,-7640242.744862489,5219269.5339601585,-446949.94215134426,-6540242.744862489,6119269.5339601585,886983.8188979052,-701371.5528624209,-6241158.163957005,3680046.411423023,4155567.993615343,-3130986.5612151613,2667443.2900212044,4875184.890210869,3119672.894708141,-1033361.8986951738,734328.7961559445,6229926.385185096	]

   		},

   		{

   			"interval":"2017-08-23T18:56:26T/2017-08-23T18:56:28T",

   			"cartesian":[-756949.94215134426,-7640242.744862489,5219269.5339601585,-446949.94215134426,-6540242.744862489,6119269.5339601585,886983.8188979052,-701371.5528624209,-6241158.163957005,3680046.411423023,4155567.993615343,-3130986.5612151613,2667443.2900212044,4875184.890210869,3119672.894708141,-1033361.8986951738,734328.7961559445,6229926.385185096	]

   		},

   		{

   			"interval":"2017-08-23T18:56:28T/2017-08-23T18:56:30T",

   			"cartesian":[-866949.94215134426,-7640242.744862489,5219269.5339601585,-446949.94215134426,-6540242.744862489,6119269.5339601585,886983.8188979052,-701371.5528624209,-6241158.163957005,3680046.411423023,4155567.993615343,-3130986.5612151613,2667443.2900212044,4875184.890210869,3119672.894708141,-1033361.8986951738,734328.7961559445,6229926.385185096	]

   		},

   		{

   			"interval":"2017-08-23T18:56:30T/2017-08-23T18:56:32T",

   			"cartesian":[-976949.94215134426,-7640242.744862489,5219269.5339601585,-446949.94215134426,-6540242.744862489,6119269.5339601585,886983.8188979052,-701371.5528624209,-6241158.163957005,3680046.411423023,4155567.993615343,-3130986.5612151613,2667443.2900212044,4875184.890210869,3119672.894708141,-1033361.8986951738,734328.7961559445,6229926.385185096	]

   		}

   

 

   	],

“width”: 1,

“material”:{

   	"solidColor" : {

   		"color":{

   			"rgba" : [223,145,123,233]

   		}

   	}

   },

  	"show": true,

   "loop": true,

   "interpolationAlgorithm":"LAGRANGE",

   "interpolationDegree":5

}

}

I apologize, I think I may have lead you down the wrong path with intervals. I think what you need instead is to use sampled property values, described here: https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Structure#sampled-property-values

Intervals describe how the value changes across discrete intervals, whereas sample properties describe sample values at specific times which can be interpolate over.

To make things easier to manage, you may also want to use reference values https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/ReferenceValue.

Here’s an example showing how to use referenced positions and interpolating between them. In this example, you can just replace polygon with a polyline and everything would still work the same. https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=CZML%20Polygon%20-%20Interpolating%20References.html&label=Showcases

Thanks,

Gabby

To add to what Gabby has said, references are actually the only way to have sampled vertex positions in CZML. Effectively you will need to model each vertex as its own independent object (though they don’t need any individual graphical representation) and then the polyline describes how the vertices are connected.

Because samples are represented in CZML as an array, and vertex positions are also an array, combining the two would have required a 2D array structure which seemed too complicated for the format, especially since using references has all the same power without needing to define a specific syntax in CZML.

You can interpolate between them. Scott was just saying that you have to use the reference values I mentioned to get it work.