From 3442d95bec01726ac8bebdd29ca6b0d8219c53d2 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 13 Sep 2014 10:52:05 +0100 Subject: Give buildings a title, even if they do not have entrances --- examples/doors.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/doors.html b/examples/doors.html index 070045e..a288885 100644 --- a/examples/doors.html +++ b/examples/doors.html @@ -100,12 +100,13 @@ console.log(roomsByUri); data.buildings.features.forEach(function(building) { - // if the building has some entrances in the data - if ("entrances" in building.properties) { + var title = document.createElement("h2"); + title.textContent = building.properties.name; - var title = document.createElement("h2"); - title.textContent = building.properties.name; + div.appendChild(title); + // if the building has some entrances in the data + if ("entrances" in building.properties) { if (building.properties.uri in buildingRooms) { var rooms = buildingRooms[building.properties.uri]; @@ -129,8 +130,6 @@ } }); - div.appendChild(title); - // create the list of entrances var table = document.createElement("table"); var thead = document.createElement("thead"); -- cgit v1.2.3