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

Cesium crashes when changing label height reference #4300

Closed
hpinkos opened this issue Sep 8, 2016 · 0 comments
Closed

Cesium crashes when changing label height reference #4300

hpinkos opened this issue Sep 8, 2016 · 0 comments

Comments

@hpinkos
Copy link
Contributor

hpinkos commented Sep 8, 2016

var viewer = new Cesium.Viewer('cesiumContainer', {
    baseLayerPicker: false,
    terrainProvider: new Cesium.CesiumTerrainProvider({
        url : 'https://assets.agi.com/stk-terrain/world'
    })
});

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

var label = labelCollection.add({
    position : Cesium.Cartesian3.fromDegrees(-110, 50),
    text: 'text',
    heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
});

var clamp = true;
Sandcastle.addToolbarButton('Toggle Height Reference', function() {
    clamp = !clamp;
    var heightReference = clamp ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE;
    label.heightReference = heightReference;
});
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