Tidied up Web Worker feature loading

0.1
Rob Hawkes 2014-02-01 11:33:10 +00:00
rodzic a4fc0857bb
commit 10442e4f70
2 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -10,6 +10,7 @@
VIZI.BuildingManager.prototype = Object.create( VIZI.ObjectManager.prototype );
// TODO: Utilise this when loading via Web Workers (right now it's not being called anywhere)
VIZI.BuildingManager.prototype.processFeature = function(feature) {
switch (feature.type) {
case "Feature":

Wyświetl plik

@ -45,7 +45,6 @@
var startTime = Date.now();
worker.process(features).then(function(data) {
//worker.processDebug({}).then(function(data) {
var timeToSend = data.startTime - startTime;
var timeToArrive = Date.now() - data.timeSent;
deferred.resolve({data: data, timeToArrive: timeToArrive, timeToSend: timeToSend});
@ -61,6 +60,8 @@
// - Each worker processes features and passes a reference back using transferable objects
// - Features are added to scene for each completed worker promise
// TODO: Move feature definition and render options into separate class (eg. BuildingManager and Building)
// - Right now, the generation of Three.js objects in this file is based on buildings
// TODO: Should be possible if geo functionality can be performed before / after the worker task
// TODO: Try and get rid of lock-up that occurs at beginning and end of worker process (possibly due to size of data being sent back and forth)
// TODO: Build objects as BufferGeometry for very easy export and messaging out of worker
@ -112,7 +113,9 @@
var combinedGeom = new THREE.Geometry();
var count = 0;
// TODO: Work out how to put feature-specific object generation in here
// - eg. Buildings, rivers, roads, etc.
_.each(features, function(feature) {
var properties = feature.properties;