OK, I tried it out and was able to get it working. I did find a few problems along the way.
-
the version of main.js that I committed earlier to fix the problem with “window” in the worker was still not quite right, I pushed a new commit. Your fix from earlier in the thread, which I assume you are still using locally, is fine though.
-
You’re right about the missing require.toUrl. The AMD loader that we use for the all-in-one Cesium file doesn’t have that feature, which I didn’t realize. I’ll put in a real fix eventually, but for now, using the direct URI to the worker file is fine. You could also do something like:
var uri = ‘…/…/Build/’ + processor._workerName + ‘.js’;
where ‘…/…/Build/’ can be replaced with the path to your directory that contains Cesium, and then the worker files will be pulled out of that same directory. I think in the long run that’s what I’ll do for the all-in-one built version, assuming I can find a way for Cesium to dynamically figure out the path to itself, so it can look for the worker scripts in that same directory.
- I hand-edited a version of createVerticesFromExtent.js to sit right next to the combined Cesium.js. This works for me in both Chrome and FF15, with a modified version of the Skeleton that uses the combined file, and removes the requirejs code from the top:
/global importScripts/
importScripts(’./Cesium.js’);
(function () {
“use strict”;
/global self/
var ExtentTessellator = Cesium.ExtentTessellator;
var postMessage = self.webkitPostMessage || self.postMessage;
self.onmessage = function(event) {
var data = event.data;
var id = data.id;
var parameters = data.parameters;
var vertices = new Float32Array(parameters.width * parameters.height * 5);
parameters.vertices = vertices;
parameters.generateTextureCoordinates = true;
parameters.interleaveTextureCoordinates = true;
ExtentTessellator.computeVertices(parameters);
postMessage({
id : id,
result : {
vertices : vertices
}
}, [vertices.buffer]);
};
})();