Hey,
I'm trying to use the billboard.computerScreenSpacePosition in 2D mode to find the position of my billboard on the screen. Looking into this function I see that it uses an actualPosition instead of the normal position attribute.
In 2D mode is the Cartesian x value suppose to be really really low? or is this a bug?
Here is a small example.
When you check the absolutePositions x value in 3D mode they seem fine. But when you switch over to 2D mode they get kind of weird.
I use the chrome debugger to read into the console.log data, I wasn't able to obtain the data in the sandcastle for whatever reason. Thanks ahead of time!
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var entities =;
var dataSource = new Cesium.CustomDataSource('myData');
viewer.dataSources.add(dataSource);
//After changing to 2D the _absolutePosition's x value
//changes to some very low weird number.
scene.morphComplete.addEventListener(function (){
console.log('Morph completed...');
console.log(scene.primitives);
});
dataSource.entities.add({
position : Cesium.Cartesian3.fromDegrees(100, 2, 0),
billboard : {
image : '../images/facility.gif'
},
customProperties :{
priority : 1,
test : 2
}
});
dataSource.entities.add({
position : Cesium.Cartesian3.fromDegrees(-30, 20, 50),
billboard : {
image : '../images/facility.gif'
},
customProperties :{
priority : 1,
test : 2
}
});
dataSource.entities.add({
position : Cesium.Cartesian3.fromDegrees(80, 100, 10),
billboard : {
image : '../images/facility.gif'
},
customProperties :{
priority : 1,
test : 2
}
});
var b = dataSource.entities.add({
position : Cesium.Cartesian3.fromDegrees(60, 25, -3),
billboard : {
image : '../images/facility.gif',
},
customProperties :{
priority : 1,
test : 2
}
});
dataSource.entities.add({
position : Cesium.Cartesian3.fromDegrees(9, 20, -10),
billboard : {
image : '../images/facility.gif'
},
customProperties :{
priority : 1,
test : 2
}
});
dataSource.entities.add({
position : Cesium.Cartesian3.fromDegrees(1, 2, 0),
billboard : {
image : '../images/facility.gif'
},
customProperties :{
priority : 1,
test : 2
}
});
var c = dataSource.entities.add({
position : Cesium.Cartesian3.fromDegrees(20, 10, 60),
billboard : {
image : '../images/facility.gif'
},
customProperties :{
priority : 1,
test : 2
}
});
var d = dataSource.entities.add({
position : Cesium.Cartesian3.fromDegrees(-1000, 3, 409),
billboard : {
image : '../images/facility.gif'
},
customProperties :{
priority : 1,
test : 2
}
});
var e = dataSource.entities.add({
position : Cesium.Cartesian3.fromDegrees(80, 80, 80),
billboard : {
image : '../images/facility.gif'
},
customProperties :{
priority : 1,
test : 2
}
});
var f = dataSource.entities.add({
position : Cesium.Cartesian3.fromDegrees(23, 21, -100),
billboard : {
image : '../images/facility.gif'
},
customProperties :{
priority : 1,
test : 2
}
});
console.log("Before Morphing, Scene Primitives:");
console.log(scene.primitives);
console.log("check chrome debugger _primitive.BillboardCollection.billboards.actualposition and morph");