summaryrefslogtreecommitdiff
path: root/examples/doors.html
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-09-13 10:52:05 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-09-13 10:52:05 +0100
commit3442d95bec01726ac8bebdd29ca6b0d8219c53d2 (patch)
tree5314cf6a8f4ae05dced520cdccbc0d6b7fc67040 /examples/doors.html
parentb32a7a349311ae6b91aaebceca06095681fafd5a (diff)
downloadleaflet-soton-3442d95bec01726ac8bebdd29ca6b0d8219c53d2.tar
leaflet-soton-3442d95bec01726ac8bebdd29ca6b0d8219c53d2.tar.gz
Give buildings a title, even if they do not have entrances
Diffstat (limited to 'examples/doors.html')
-rw-r--r--examples/doors.html11
1 files 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");