How to find cesiumWorkerBootstrapper.js ? 404 Not Found

I’ve been using pre-b10 Cesium.js simply (naively) from my app:

<script type="text/javascript" src="Cesium.js"></script>

and getting the HTML that invokes that with a URL like

http://localhost/~chris/sot/viz/

and all’s been well.

I’ve updated to b10 and now find Cesium.js throwing 404s while trying to find cesiumWorkerBootstrapper.js. In 90f5cfa, this happens at the unminified Cesium.js:57812


function createWorker(processor) {

var worker = new Worker(getBootstrapperUrl());

When getBootstrapperUrl() returns: “/cesiumWorkerBootstrapper.js”

If this is not (no longer?) built into the uber-file Cesium.js, what’s the right way to be making it available to my HTML and JS?

I see the suggestion to define global CESIUM_BASE_URL and I can fake it by defining it to be “.” but it seems awkward.

I think I am missing the big picture. Any pointers?

Thanks.

In b10, because we’re starting to make use of Web Workers to offload expensive calculations such as tesselating the globe, Cesium.js now has several additional files, one for each worker (web workers have to be loaded as separate scripts, so they can’t be combined into the single file). If you look in Build, there are currently:

Cesium.js

cesiumWorkerBootstrapper.js

createVerticesFromExtent.js

(in the future we will have additional workers for terrain such as createVerticesFromHeightMap, etc.)

All of these are required, and are expected to be located next to each other. The getBootstrapperUrl attempts to figure out the relative URL automatically, but it looks like you’ve found a bug in the regex I’m using. It should be calculating ‘cesiumWorkerBootstrapper.js’ without that slash.

I’ll work on a fix, but in the meantime, you can work around the problem by either setting a global var CESIUM_BASE_URL = ‘.’ as you found, or by moving the Cesium.js files into a subdirectory, making the script tag look like:

Sorry for the trouble.

In b10, because we’re starting to make use of Web Workers to offload expensive calculations such as tesselating the globe, Cesium.js now has several additional files, one for each worker (web workers have to be loaded as separate scripts, so they can’t be combined into the single file). If you look in Build, there are currently:

Cesium.js

cesiumWorkerBootstrapper.js

createVerticesFromExtent.js

That makes sense – just didn’t realize what they were for nor how to load them properly.

All of these are required, and are expected to be located next to each other. The getBootstrapperUrl attempts to figure out the relative URL automatically, but it looks like you’ve found a bug in the regex I’m using. It should be calculating ‘cesiumWorkerBootstrapper.js’ without that slash.

I’ll work on a fix, but in the meantime, you can work around the problem by either setting a global var CESIUM_BASE_URL = ‘.’ as you found, or by moving the Cesium.js files into a subdirectory, making the script tag look like:

Moving them into a common subdirectory’s nice and neat, works great – thanks a bunch!