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

KML Network link error when switching scene modes #3865

Closed
hpinkos opened this issue Apr 20, 2016 · 2 comments
Closed

KML Network link error when switching scene modes #3865

hpinkos opened this issue Apr 20, 2016 · 2 comments

Comments

@hpinkos
Copy link
Contributor

hpinkos commented Apr 20, 2016

In this example, click the button to load the data. Then after the data is loaded, switch the scene mode. It causes a crash because camera.pitch is undefined when the scene mode is morphing.
This error only happens when you pass in options.camera and options.canvas (which is now required).

var viewer = new Cesium.Viewer('cesiumContainer');
var options = {
    camera : viewer.scene.camera,
    canvas : viewer.scene.canvas
};

Sandcastle.addToolbarButton('Load KML Network link',
    function() {
        var kmlText='<kml><NetworkLink>' +
            '<name><![CDATA[Test]]></name>' +
            '<refreshVisibility>0</refreshVisibility>' +
            '<flyToView>0</flyToView>' +
            '<Link><href><![CDATA[../../SampleData/kml/facilities/facilities.kml]]></href>' +
            '<viewRefreshMode>onStop</viewRefreshMode>' +
            '<viewRefreshTime>0</viewRefreshTime>' +
            '<viewFormat>BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]</viewFormat>' +
            '</Link></NetworkLink></kml>';
        var dom = new DOMParser().parseFromString(kmlText, 'text/xml');
        viewer.camera.flyHome(0);
        viewer.dataSources.add(Cesium.KmlDataSource.load(dom, options));
    });

Sandcastle.reset = function() {
    viewer.dataSources.removeAll();
    viewer.clock.clockRange = Cesium.ClockRange.UNBOUNDED;
    viewer.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK;
};
@hpinkos
Copy link
Contributor Author

hpinkos commented Apr 20, 2016

@hpinkos
Copy link
Contributor Author

hpinkos commented Apr 21, 2016

Closed by #3868

@hpinkos hpinkos closed this as completed Apr 21, 2016
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