summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/leaflet-soton.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js
index accd7f7..5851158 100644
--- a/src/leaflet-soton.js
+++ b/src/leaflet-soton.js
@@ -1677,13 +1677,25 @@ L.IndoorLayer = L.Class.extend({
return;
}
- if (level in layers) {
- layer = layers[level];
+ if (L.Util.isArray(level)) {
+ level.forEach(function(level) {
+ if (level in layers) {
+ layer = layers[level];
+ } else {
+ layer = layers[level] = L.geoJson({ type: "FeatureCollection", features: [] }, options);
+ }
+
+ layer.addData(part);
+ });
} else {
- layer = layers[level] = L.geoJson({ type: "FeatureCollection", features: [] }, options);
- }
+ if (level in layers) {
+ layer = layers[level];
+ } else {
+ layer = layers[level] = L.geoJson({ type: "FeatureCollection", features: [] }, options);
+ }
- layer.addData(part);
+ layer.addData(part);
+ }
});
},
getLevels: function() {