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

Bug setting label position and heightReference #5609

Closed
hpinkos opened this issue Jul 11, 2017 · 0 comments
Closed

Bug setting label position and heightReference #5609

hpinkos opened this issue Jul 11, 2017 · 0 comments

Comments

@hpinkos
Copy link
Contributor

hpinkos commented Jul 11, 2017

In the following example, the Change Position button stops working after you click the Unclamp button. It resumes working if you hit the Clamp button to reset heightReference: Cesium.HeightReference.CLAMP_TO_GROUND;

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

var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({
    url : 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles',
    requestWaterMask : true,
    requestVertexNormals : true
});
viewer.terrainProvider = cesiumTerrainProviderMeshes;

var labels = scene.primitives.add(new Cesium.LabelCollection({
    scene: scene
}));
var label = labels.add({
    text: 'Test label',
    heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
    position: Cesium.Cartesian3.fromDegrees(-75.1641667, Cesium.Math.randomBetween(0, 50), 150)
});

Sandcastle.addDefaultToolbarButton('Clamp', function() {
    label.heightReference = Cesium.HeightReference.CLAMP_TO_GROUND;
});

Sandcastle.addToolbarButton('Unclamp', function() {   
    label.heightReference = Cesium.HeightReference.NONE;
});

Sandcastle.addToolbarButton('Change Position', function() {   
    label.position = Cesium.Cartesian3.fromDegrees(-75.1641667, Cesium.Math.randomBetween(0, 50), 150);
});
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

1 participant