From 2390bfe4a1a7614008175639210948ce2c40af63 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 19 Jul 2014 13:55:46 +0100 Subject: Improve support for multi level rooms --- src/leaflet-soton.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3