Hello everyone,
I recently started to dev on Cesium for an important project on my start up, but suddently, I think after an update from Cesium, my basic function therefore doesn't work anymore and I can't find a way to debug it.
I think the problem is around the positions of polyline but I don't really know what to change since it worked perfectly just a few weeks ago.
I'm using Cordova and Firefox in Ubuntu for testing but this code doesn't work in SandCastle neither.
I linked my entire index.html files if you want to see more details.
Thank you so much
function drawLine(EntryPosition,ExitPosition){
var flighAltitude = 500;
var CartographicEntry = Cesium.Ellipsoid.WGS84.cartesianToCartographic(EntryPosition);
var CartographicExit = Cesium.Ellipsoid.WGS84.cartesianToCartographic(ExitPosition);
var lineParams = {
name : 'Tunnel',
polyline : {
positions : Cesium.Cartesian3.fromDegreesArrayHeights([Cesium.Math.toDegrees(CartographicEntry.longitude),Cesium.Math.toDegrees(CartographicEntry.latitude), flightAltitude,
Cesium.Math.toDegrees(CartographicExit.longitude),Cesium.Math.toDegrees(CartographicExit.latitude), flightAltitude]),
width : 4,
material : new Cesium.PolylineDashMaterialProperty({
color: Cesium.Color.CYAN
})
}
};
viewer.entities.add(lineParams);
secondaryViewer.entities.add(lineParams);
}
Can you tell me what you mean by “doesn’t work” ? Does it produce an error? Is a line not drawn?
I put your code in Sandcastle here, and after fixing a typo with the “flightAltitude” variable, I can see a line drawn when I hit the “go there” button.
Oh my god that was so stupid :') just so you know, we were 5 people trying to solve this problem without seeing this obvious informaticien mistake :')
I was trying to debug the whole "complicated" line just below
Me and my student team are trying to develop a sort of Waze for plane pilotes, where in the long term it should be able to be used by a drone so it is piloted by its own and be able to literally dodge every building, planes, helicopters and other drones in its way.
Anyway, thank you so much for your help and concern
Since I'm here, do you have any idea if it is possible with Cesium to have an online server (prolly Node.js for praticity) where our mobile application takes in-time data (like positions of other planes which change every second) so we can literally see other planes moving in this app? Thank you again
That sounds like a really cool application - once it’s done you should reach out to me at omar@cesium.com or post about it here, it would be awesome to showcase it or maybe even do a guest blog post on the Cesium blog (https://cesium.com/blog/)!
As for hooking up Cesium with an online server for real-time data, that is definitely possible! I’ve been meaning to write a tutorial specifically about all the features in Cesium that make it easy to work with real time data, but some of the code examples on Sandcastle should be helpful here. Particularly this one which shows you how to have position/rotation data tagged with timestamps, and be able to see them across time, controlled by the timeline:
Cesium can interpolate between timestamps, so typically what you’d do is buffer data so the visualization is 10 to 30 seconds behind the real time feed so it can smoothly interpolate between each point as it comes in.