diff options
-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(); |