diff options
author | Christopher Baines <cb15g11@soton.ac.uk> | 2014-08-10 10:41:32 +0100 |
---|---|---|
committer | Christopher Baines <cb15g11@soton.ac.uk> | 2014-08-10 10:41:32 +0100 |
commit | 96744e1ef5e10a7bcf22803df7180cabdc42989f (patch) | |
tree | feae2598b35b15377556bd4f5fcd8850aa6b662a | |
parent | 6386aaedb30958b4f0bf1fd863cba88f14c61208 (diff) | |
download | leaflet-soton-96744e1ef5e10a7bcf22803df7180cabdc42989f.tar leaflet-soton-96744e1ef5e10a7bcf22803df7180cabdc42989f.tar.gz |
Don't attempt to switch to undefined levels
-rw-r--r-- | src/leaflet-soton.js | 10 |
1 files 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(); |