From 96744e1ef5e10a7bcf22803df7180cabdc42989f Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 10 Aug 2014 10:41:32 +0100 Subject: Don't attempt to switch to undefined levels --- src/leaflet-soton.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index 799b2a4..1a47ce9 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -815,10 +815,12 @@ SELECT * WHERE {\ var bounds = L.latLngBounds(coords); this.fitBounds(bounds); - if (L.Util.isArray(feature.properties.level)) { - this.setLevel(feature.properties.level[0]); - } else { - this.setLevel(feature.properties.level); + if ("level" in feature.properties) { + if (L.Util.isArray(feature.properties.level)) { + this.setLevel(feature.properties.level[0]); + } else { + this.setLevel(feature.properties.level); + } } this.closePopup(); -- cgit v1.2.3