Skip to content

There is a problem with setting showBackground to true for label #12390

@PFeiJia

Description

@PFeiJia

What happened?

The Label property show defaults to false and showBackground defaults to true. Adding labels with LabelCollection and setting the Label's show to true should display the Label background, but it doesn't

Reproduction steps

const viewer = new Cesium.Viewer("cesiumContainer");

const labels = viewer.scene.primitives.add(new Cesium.LabelCollection());

const label = labels.add({
  show:false,
  showBackground: true,
  position : new Cesium.Cartesian3(1.0, 2.0, 3000000.0),
  text : 'label showBackground',
});

setTimeout(()=>{
  label.show = true;
},1000);

Sandcastle example

No response

Environment

Browser: Google
CesiumJS Version: 1.122
Operating System:Windows 11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions