Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New label appears at position of old label #5647

Closed
hpinkos opened this issue Jul 18, 2017 · 1 comment
Closed

New label appears at position of old label #5647

hpinkos opened this issue Jul 18, 2017 · 1 comment

Comments

@hpinkos
Copy link
Contributor

hpinkos commented Jul 18, 2017

  1. Click the Destroy button to remove the first label
  2. Click the Label 2 button to add a new label
  3. Zoom in towards the middle of the globe. Eventually the new label will appear around the spot the old label was, even though the new label has no position

This is specific to labels, it does not happen with billboards. It also only happens when using the CLAMP_TO_GROUND height reference

var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;

var labelCollection = scene.primitives.add(new Cesium.LabelCollection({
    scene: scene
}));

var label = labelCollection.add({
    heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
    text: 'label 1',
    position:  new Cesium.Cartesian3(-748060.358557192, -4909764.442609902, 3988488.2144659692)
});

Sandcastle.addToolbarButton('Destroy', function() {
    labelCollection.remove(label);
});

Sandcastle.addToolbarButton('Label 2', function() {
    labelCollection.add({
        heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
        text: 'label 2'
    });
});
@mramato
Copy link
Contributor

mramato commented Jul 18, 2017

This sounds similar to a billboard bug I fixed in #5339. My guess is that label caching isn't clearing the clamped state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants