summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-10-06 10:13:03 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-10-06 10:13:03 +0100
commit5f043713e59030cfdcf722e25ffb034a103080ab (patch)
tree2f8082351061545a23d9e06fa5e58a5018b18947 /examples
parent5c814b6a2d99ec06a960c88f0af7c1670479680e (diff)
downloadleaflet-soton-5f043713e59030cfdcf722e25ffb034a103080ab.tar
leaflet-soton-5f043713e59030cfdcf722e25ffb034a103080ab.tar.gz
Count the number of mapped/unmapped teaching rooms
Diffstat (limited to 'examples')
-rw-r--r--examples/teachingrooms.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/teachingrooms.html b/examples/teachingrooms.html
index 36ab2a1..7a5ca30 100644
--- a/examples/teachingrooms.html
+++ b/examples/teachingrooms.html
@@ -186,6 +186,9 @@
singleMarkerMode: true
});
+ var totalMappedTeachingRooms = 0;
+ var totalUnMappedTeachingRooms = 0;
+
data.buildings.features.forEach(function(building) {
var roomsMissing = 0;
@@ -207,6 +210,9 @@
if (!("center" in room.properties)) {
roomsMissing += 1;
+ totalUnMappedTeachingRooms += 1;
+ } else {
+ totalMappedTeachingRooms += 1;
}
});
}
@@ -221,6 +227,12 @@
}
});
+ console.log("Total mapped teaching rooms: " + totalMappedTeachingRooms);
+ console.log("Total un-mapped teaching rooms: " + totalUnMappedTeachingRooms);
+ console.log("Percentage done: " + ((totalMappedTeachingRooms /
+ (totalMappedTeachingRooms +
+ totalUnMappedTeachingRooms)).toFixed(2) * 100) + "%");
+
map.addLayer(markers);
});