Do we have access to object's description attribute?

In our project, we used to have a function to modify an object's attribute, usually a user added pin and save the coordinates along with the description. Like the snippet below.

var tempId = document.getElementById("googleMapFeatureId").value; var features=ge.getGlobe().getFeatures().getChildNodes(); for (var i = 0; i < features.getLength(); i++) {
    if (features.item(i).getId() == tempId) {
        features.item(i).setDescription("New Object Created By User");
        break;
    } else {
        continue;
    } }

Do we have something similar so I can do something?
Thanks

Hello,

Have you seen our examples for migrating from google earth? http://cesiumjs.org/for-google-earth-developers.html

There’s a lot of helpful information and examples on that page.

You can change all of the pin attributes by setting them to a new value. Here’s an example that changes the color and size on mouse over:

var viewer = new Cesium.Viewer(‘cesiumContainer’, {timeline : false, animation : false});

var pinBuilder = new Cesium.PinBuilder();

var pin = viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.170726, 39.9208667),
billboard : {
image : pinBuilder.fromColor(Cesium.Color.ROYALBLUE, 48).toDataURL(),
verticalOrigin : Cesium.VerticalOrigin.BOTTOM
}
});

var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction(function(movement) {
var pickedObject = viewer.scene.pick(movement.endPosition);
if (Cesium.defined(pickedObject) && (pickedObject.id === pin)) {
pin.billboard.scale = 2.0;
pin.billboard.color = Cesium.Color.YELLOW;
} else {
pin.billboard.scale = 1.0;
pin.billboard.color = Cesium.Color.WHITE;
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);

viewer.zoomTo(pin);

``

Hope this helps!

Best,

Hannah

Also, be sure to check out the Visualizing Spatial Data tutorial, which has a section that specifically deals with descriptions.