what happened to CesiumViewerWidget, and what is the replacement?

Hi,

It's been a while I had a chance to work with Cesium, and about a good
moth ago I was using CesiumViewerWidget (in the batching branch). I see
it's gone now - I wonder what the intended replacement is?

best regards,

Akos

This was announced about a month ago, without much fanfare, but it’s a big improvement to our widget collection.

–Ed.

I see - thanks for the link.
the above post talks about an updated sandcastle sample, but the one
I’m seeing:
gives me errors:
also, I wonder if there is a sample where a Viewer is put
into a django environment?

Try clearing your cache, or running Incognito Mode (Chrome) or Private Browsing mode (Firefox).

I don’t know of any effort to integrate with Django. Let us know how it goes, if you try it.

–Ed.

Try clearing your cache, or running Incognito Mode (Chrome) or Private
Browsing mode (Firefox).

I'm getting the same error in incognito mode (chrome) or in firefox :frowning:

I don't know of any effort to integrate with Django. Let us know how
it goes, if you try it.

ok, will do

I’m trying to write a Cesium.Viewer VWF application, and I’m exactly sure what to do about including all of the required files.

I have the build from r18 down in a support path which is common to all vwf applications. We’ve had trouble getting the files to all be found relatively from Cesium.js. One of my coworkers modified the minified version to get our Cesium.Widget applications to work properly. The viewer adds a little more complexity to the situation.

In CesiumViewerStartup, I see the baseUrl which I’m assuming should be the path to the r18 build. Then there needs to be a path to the cesiumViewer.js file, and the requireJS folder. Is that all I need to include?

We currently load require 2.1.5, was there a specific reason for using 2.1.6?

Scott

Are you on a slow internet connection by any chance? By default, RequireJS
expects to be able to download and parse all modules within 7 seconds.
Because Sandcastle loads each of the individual Cesium modules, this means
it needs to download several hundred individual scripts.

Can you try running Sandcastle locally to see if it works? I'll make a
quick change to Cesium to increase the timeout that Sandcastle uses when
loading examples. I recently had to increase the timeout used by our tests
because having Firebug active in Firefox slowed it down so severely that 7
seconds wasn't enough time, even when loading from localhost.

I'm trying to write a Cesium.Viewer VWF application, and I'm exactly sure
what to do about including all of the required files.

I have the build from r18 down in a support path which is common to all
vwf applications. We've had trouble getting the files to all be found
relatively from Cesium.js. One of my coworkers modified the minified
version to get our Cesium.Widget applications to work properly. The viewer
adds a little more complexity to the situation.

Can you explain what modifications your coworker made to the minified
version?

I think the main problem is that the single-file Cesium.js is not meant to
be loaded by an AMD loader such as RequireJS. Cesium.js is for
applications that aren't using AMD, and is intended to be loaded directly
with a <script> tag, because it handles all module resolution internally,
and exposes a global Cesium object.

I took a look at the VWF github repo to get a sense of how your application
works, and I think that given that your application is based on AMD, you
may have better results by including the Source directory somewhere in your
application, instead of the built file. You can require in the Cesium
modules just like you require in your various vwf modules. All of the
module identifiers should be relative within in Cesium, so it shouldn't
matter where the Cesium modules are located, as long as the relative paths
to each other stay the same (e.g. Core as a sibling of Renderer).

We currently load require 2.1.5, was there a specific reason for using

2.1.6?

Either version should be fine. 2.1.6 was the most recent at the time when
we last updated.

Our driver configuration does use require. If I include the files from ‘Source’ using require, do I just need to include a reference to the main object I’m using? Like the CesiumWidget for example?

Scott

Yes. Anything that e.g. CesiumWidget depends on will be automatically included as well behind the scenes.

I just noticed that the Source has a Cesium.js, so I’m loading that now with our driver configuration(requirejs). Requirejs isn’t picking up on the correct path of Cesium.js, so none of the files in the first parameter to define were being loaded. I worked around that by adding the ‘…/cesium/’ to the beginning of each file reference. That fixed all of my errors, but Cesium is still undefined. bummer

Scott

After my earlier email, I found the same problem with Cesium.js not using relative module IDs, and a fix just got merged to master. That fix is basically the same as what you describe, by changing Cesium.js from:

define([‘Core/AxisAlignedBoundingBox’, ‘Core/BoundingRectangle’, //etc

to

define([’./Core/AxisAlignedBoundingBox’, ‘./Core/BoundingRectangle’, //etc

Ok, I’ve got a branch ( branch/cesium ), but let me double check to make sure I have all of the files pushed up.

Thanks,

Scott

Ok, everything should be ready to go. I’ve pushed the Source folder from r18 into support/client/lib/vwf/model/cesium with the change you mentioned into Cesium.js( adding ‘./’ to the path of all of the files ).

https://github.com/virtual-world-framework/vwf/tree/branch/cesium

Thanks,

Scott

Ok, I took a look at the branch, and I think what you have will work if you add “vwf/model/cesium/Cesium” to the the dependency arrays in the places where you want to use Cesium, specifically in these two modules:

https://github.com/virtual-world-framework/vwf/blob/branch/cesium/support/client/lib/vwf/model/cesium.js#L18

https://github.com/virtual-world-framework/vwf/blob/branch/cesium/support/client/lib/vwf/view/cesium.js#L34

At the point where we call creatingNode for the cesium instance Cesium is undefined. :frowning: If I check in the console after that Cesium is defined, so it looks like an issue where the Cesium files aren’t loaded in time for the inital calls to create the scene.

Scott

Also, I pulled down branch/cesium and some of the files from Shader are missing. I copied over the missing files, but git doesn’t see them as being added to the branch. I’m not sure what is going on there.

Those js files in the Shaders folder are generated by the build, and then they are set up to be ignored. I’m surprised that file ignored carried over to my branch, but then again, I’m always learning something new about git.

Scott

Are you on a slow internet connection by any chance?

no, I have 120Mb/s downstream, and everything works fine regarding my
net connection

By default, RequireJS expects to be able to download and parse all
modules within 7 seconds. Because Sandcastle loads each of the
individual Cesium modules, this means it needs to download several
hundred individual scripts.

I see

Can you try running Sandcastle locally to see if it works?

it works fine locally, so is must be the network timeout

looking at the code, now I see the essence of the change, that dojo has
been removed and 'raw' divs, events, etc put in place. I'll have to
update my code then...

I'll make a quick change to Cesium to increase the timeout that
Sandcastle uses when loading examples. I recently had to increase the
timeout used by our tests because having Firebug active in Firefox
slowed it down so severely that 7 seconds wasn't enough time, even
when loading from localhost.

yes, this could work

As far as I can tell from reading the code, I would expect that to work. Can you push the changes I mentioned to add the vwf/model/cesium/Cesium modules to the dependency arrays?

Is it possible that an old version of the files are cached by your browser? Try clearing cache. Next, in Chrome, you can load the app with the Network tab in the developer tools open, and check to make sure that the expected files are being loaded from the right place.

Finally, to add your missing files, you should remove the .gitignore files from the Cesium folder and from Cesium/Shaders.

It’s working now. :slight_smile: thanks. I’m not sure what changed.

I do have the cache disabled, so I don’t think that was the issue.

Scott