Commit b5d56edb authored by Athanasios's avatar Athanasios
Browse files

bug fix

parent 03780bf6
......@@ -34,7 +34,7 @@ define([
StatusBar.beginProcess("Waiting for response");
request(url, { handleAs: "json" })
.then(function (portrayalNodes) {
.then(async (portrayalNodes) => {
if (portrayalNodes.length == 0) {
NodeCache.clearAll();
......@@ -47,19 +47,22 @@ define([
if (requestTime < CameraChangeEvent.getTime()) return;
let responseIds = portrayalNodes.map(n => { return n.id; });
NodeCache.matchAll(responseIds);
let mapper = new CesiumMapper();
StatusBar.beginProcess("Processing");
try {
portrayalNodes.forEach(async (node) => {
if (requestTime < CameraChangeEvent.getTime()) throw BreakException;
if (!NodeCache.contains(node.id)) {
let instances = await mapper.map(node);
NodeCache.add(instances, node);
}
});
await Promise.all(
portrayalNodes.map(async (node) => {
if (requestTime < CameraChangeEvent.getTime()) throw BreakException;
if (!NodeCache.contains(node.id)) {
let instances = await mapper.map(node);
await NodeCache.add(instances, node);
}
})
);
StatusBar.endProcess();
topic.publish("PortrayalResponseHandled", "SceneRendered");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment