From 5f043713e59030cfdcf722e25ffb034a103080ab Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 6 Oct 2014 10:13:03 +0100 Subject: Count the number of mapped/unmapped teaching rooms --- examples/teachingrooms.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'examples/teachingrooms.html') 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); }); -- cgit v1.2.3