diff options
author | Christopher Baines <cb15g11@soton.ac.uk> | 2014-09-27 15:55:12 +0100 |
---|---|---|
committer | Christopher Baines <cb15g11@soton.ac.uk> | 2014-09-27 15:55:12 +0100 |
commit | bb828eb90b274d714f0a6e84a8dbb9ddd6c86689 (patch) | |
tree | 7b9072ea915412123049082bed0dbef73e1ffc43 /src | |
parent | 77c38d655545ec3e23a786fb36271c2bd69b08f3 (diff) | |
download | leaflet-soton-bb828eb90b274d714f0a6e84a8dbb9ddd6c86689.tar leaflet-soton-bb828eb90b274d714f0a6e84a8dbb9ddd6c86689.tar.gz |
Add rooms only found in OSM to the list of rooms in a building
Previously, only the rooms in the University data was used, but this leaves a
lot out. Also display popups for rooms if they have a URI, to allow the user to
navigate to the uri.
Diffstat (limited to 'src')
-rw-r--r-- | src/leaflet-soton.js | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index 0eb51be..ec86a7d 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -416,18 +416,10 @@ SELECT * WHERE {\ return; // No popup for corridors yet } - if( !('features' in feature.properties) ) { feature.properties.features=[]; } - if( !('contents' in feature.properties) ) { feature.properties.contents=[]; } - if( !('images' in feature.properties) ) { feature.properties.images=[]; } + if (feature.properties.buildingspart === "room" && + !("uri" in feature.properties)) { - if ('buildingpart' in feature.properties) { - if (feature.properties.buildingpart === "room" && - feature.properties.features.length == 0 && - feature.properties.contents.length == 0 && - feature.properties.images.length == 0) { - - return false; - } + return false; } return true; @@ -1201,9 +1193,11 @@ SELECT * WHERE {\ function imageTemplate(properties, options, map, close) { - if (properties.images.length == 0) { + if (!("images" in properties)) + return false; + + if (properties.images.length === 0) return false; - } var imageWidth; var imageHeight; @@ -1276,7 +1270,7 @@ SELECT * WHERE {\ var room = LS.getFeatureByURI(uri); if (room === null) { - console.err("Unable to find room " + uri); + console.error("Unable to find room " + uri); return; } |