You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi ,
I saw this code that finds html coordinates from entity and place a div on that position
var scratch3dPosition = new Cesium.Cartesian3();
var scratch2dPosition = new Cesium.Cartesian2();
// Every animation frame, update the HTML element position from the entity.
viewer.clock.onTick.addEventListener(function(clock) {
var position3d;
var position2d;
// Not all entities have a position, need to check.
if (entity.position) {
position3d = entity.position.getValue(clock.currentTime, scratch3dPosition);
}
// Moving entities don't have a position for every possible time, need to check.
if (position3d) {
position2d = Cesium.SceneTransforms.wgs84ToWindowCoordinates(
viewer.scene, position3d, scratch2dPosition);
}
// Having a position doesn't guarantee it's on screen, need to check.
if (position2d) {
// Set the HTML position to match the entity's position.
testElement.style.left = position2d.x + 'px';
testElement.style.top = position2d.y + 'px';
// Reveal HTML when entity comes on screen
if (!isEntityVisible) {
isEntityVisible = true;
testElement.style.display = 'block';
}
} else if (isEntityVisible) {
// Hide HTML when entity goes off screen or loses its position.
isEntityVisible = false;
testElement.style.display = 'none';
}
});
here for me SceneTransforms is coming undefined inspite of having values in all the three arguments passed to it.
Can someone help here??
Reported on the forum: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/ALIPbA_LSqU
The text was updated successfully, but these errors were encountered: