"use strict";
//const angular = require("angular");

let app = require("./vismod");

const $ = require("jquery"),
    factories = require("./factories");

require("./socket");

$.get("/data/doc-min-1.geojson", (data) => {
    if (typeof data === typeof "") {
        data = JSON.parse(data);
    }

    let points = window.points = [];
    console.log("There are " + data.features.length);
    for (let i = 0; i < data.features.length; i++) {
        let point = data.features[i].geometry.coordinates;
        point.active = data.features[i].properties.styleUrl
            .toLowerCase().indexOf("active") !== -1;
        point.jid = data.features[i].id;

        if (
            (point[0] >= app.meta.location.lat - 30)
            && (point[0] <= app.meta.location.lat + 30)
            && (point[1] >= app.meta.location.lon - 30)
            && (point[1] <= app.meta.location.lon + 30)
        ) {
            points.push(point);
        }
    }

    app.junkMeshes = [];

    console.log("" + points.length + " are nearby");
    for (let i = 0; i < points.length; i++) {
        let point = points[i];

        let mesh = factories.junkFactory(point[0], point[1], point[2],
            point.active);
        mesh.meta = {
            active: point.active,
            id: point.jid
        };
        app.junkMeshes.push(mesh);

        app.scene.add(mesh);
    }
});

@@ -50,131 +50,293 @@
 );%0A%0A
-let app = require(%22./vismod%22);%0A%0Aconst $ = require(%22jquery%22),%0A    factories = require(%22./factories%22);%0A%0Arequire(%22./socket%22);%0A
+// Visualisation module, used for the THREE stuff.%0Alet app = require(%22./vismod%22);%0A%0A// Dom manipulation and factory functions respectively.%0Aconst $ = require(%22jquery%22),%0A    factories = require(%22./factories%22);%0A%0A// Communication with the server%0Arequire(%22./socket%22);%0A%0A// Fetch the dataset.
 %0A$.g
@@ -377,16 +377,52 @@
 a) =%3E %7B%0A
+    // If string, parse into object%0A
     if (
@@ -486,24 +486,71 @@
 ta);%0A    %7D%0A%0A
+    // points - global for debugging purposes.%0A
     let poin
@@ -895,16 +895,115 @@
 i%5D.id;%0A%0A
+        // Filter points based on approximate proximity to%0A        // the player's spawn location.%0A
         
@@ -1442,24 +1442,82 @@
 points%5Bi%5D;%0A%0A
+        // construct the cubes used to display the items.%0A
         let 

comment main.js