labels problem

Hi

Recently upgraded to Cesium 1.11 and I notice a change in the behaviour of my program.

Long story short, I want show a label next to an object when you pass the mouse over it and remove the label in other case.

Before the update my code worked, it’s possible that I changed something without notice and this be a stupid error unrelated with the new version.

I do this for transparent polygons mostly.

My question:

Why the code below show the label of some geometric figures and not the others?. The stripeMaterial, white outlined rectangle of the middle for example.

As example you can add the next code after the Geometry and Appearances sandcastle.

Thank you for your time and excuse my English.

https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Geometry%20and%20Appearances.html&label=Showcases

var scene = viewer.scene;
var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);

var previousId;
var previousEntit;
handler.setInputAction(
function (movement) {

  var pickedObject = scene.pick(movement.endPosition);

  if (pickedObject === undefined || pickedObject.id === undefined || pickedObject.id.id === undefined){
   
    if (previousId !== undefined){
      viewer.entities.getById(previousId).label = undefined;
      previousId = undefined;
    }
    return;
  }
  else if(pickedObject.id.id === previousId){
      //console.log('equals?'+previousId+'==='+pickedObject.id.id);
  }
  else{

     var id = pickedObject.id.id;
     //sanity output
     console.log(id);
     
     pickedObject.id.label = new Cesium.LabelGraphics({text:id,
                              font : '20pt Lucida Console',
                              horizontalOrigin:Cesium.HorizontalOrigin.LEFT,
                              verticalOrigin:Cesium.VerticalOrigin.CENTER,
                              outlineWidth:3,
                              pixelOffset: new Cesium.Cartesian2(20,0),
                              fillColor:Cesium.Color.BLACK,
                              outlineColor:Cesium.Color.WHITE,
                              style: Cesium.LabelStyle.FILL_AND_OUTLINE});
    if (previousId !== undefined){
        viewer.entities.getById(previousId).label = undefined;
    }
     previousId = id;
     
  }

},
Cesium.ScreenSpaceEventType.MOUSE_MOVE);

``

Label requires that the entity has a valid “position” property; but not all geometry has such a property. You can fix this by setting a center point for the geometry when you construct the entity. This isn’t a change in behavior, it’s always been this way.