Skip to content

Tutorial does not work: you need to call CesiumWidget() first, then Viewer() #72

@eHanseJoerg

Description

@eHanseJoerg

When trying to follow the tutorial within a Jupyter notebook, I noticed that I get an error:

import cesiumpy

v = cesiumpy.Viewer()
b = cesiumpy.Box(dimensions=(40e4, 30e4, 50e4), material=cesiumpy.color.RED, position=[-120, 40, 0])
v.entities.add(b)

Javascript error adding output!
ReferenceError: Cesium is not defined
See your browser Javascript console for more details.

If I do this instead:

import cesiumpy

v = cesiumpy.CesiumWidget()

v

Then I get the nice globe. If I now call the first code in a new cell once again, it will work just fine. Seems to me that the Viewer() method is not loading cesium.js correctly.

Using Firfox on Ubuntu 16.04.

See screenshots.
cesium1
cesium2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions