diff options
author | Christopher Baines <cb15g11@soton.ac.uk> | 2014-07-19 13:55:46 +0100 |
---|---|---|
committer | Christopher Baines <cb15g11@soton.ac.uk> | 2014-07-19 14:22:13 +0100 |
commit | 2390bfe4a1a7614008175639210948ce2c40af63 (patch) | |
tree | 754469e616c54dd15c90387188bfd4c2ea777b75 | |
parent | 076c96dad31f1acdab6b28383ee28a72542d0098 (diff) | |
download | leaflet-soton-2390bfe4a1a7614008175639210948ce2c40af63.tar leaflet-soton-2390bfe4a1a7614008175639210948ce2c40af63.tar.gz |
Improve support for multi level rooms
-rw-r--r-- | src/leaflet-soton.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index ded6bf8..1d995f7 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -764,7 +764,9 @@ SELECT * WHERE {\ var bounds = L.latLngBounds(coords); this.fitBounds(bounds); - if ("level" in feature.properties) { + if (L.Util.isArray(feature.properties.level)) { + this.setLevel(feature.properties.level[0]); + } else { this.setLevel(feature.properties.level); } @@ -775,7 +777,11 @@ SELECT * WHERE {\ this.setView(L.GeoJSON.coordsToLatLng(feature.geometry.coordinates), 22); if ("level" in feature.properties) { - this.setLevel(feature.properties.level); + if (L.Util.isArray(feature.properties.level)) { + this.setLevel(feature.properties.level[0]); + } else { + this.setLevel(feature.properties.level); + } } else { // If this is a workstation if (uri.indexOf("http://id.southampton.ac.uk/point-of-service/workstations") === 0) { |