-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add sun and moon labels #1218
Labels
Comments
Merged
No one has asked for this except me and this can be done at the app level so I am OK with closing this. Anyone feel otherwise? |
Can we post a sample of app code that does this? |
@emackey, here's a quick 2 minute example I whipped up using the Entity API. In 3D the near/far plane kicks in so you don't see them, but they do work in 2D. var viewer = new Cesium.Viewer('cesiumContainer');
var sunPositionProperty = new Cesium.CallbackProperty(function(time, result){
Cesium.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(time, result);
return Cesium.PositionProperty.convertToReferenceFrame(
time,
result,
Cesium.ReferenceFrame.INERTIAL,
Cesium.ReferenceFrame.FIXED,
result);
}, false);
var moonPositionProperty = new Cesium.CallbackProperty(function(time, result){
Cesium.Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(time, result);
return Cesium.PositionProperty.convertToReferenceFrame(
time,
result,
Cesium.ReferenceFrame.INERTIAL,
Cesium.ReferenceFrame.FIXED,
result);
}, false);
viewer.entities.add({
position : sunPositionProperty,
label : {
text : 'Sun'
}
});
viewer.entities.add({
position : moonPositionProperty,
label : {
text : 'Moon'
}
}); |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
As mentioned in #1189
The text was updated successfully, but these errors were encountered: