aboutsummaryrefslogtreecommitdiff
path: root/leaflet-indoor.js
diff options
context:
space:
mode:
Diffstat (limited to 'leaflet-indoor.js')
-rw-r--r--leaflet-indoor.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/leaflet-indoor.js b/leaflet-indoor.js
index c49f624..aede15c 100644
--- a/leaflet-indoor.js
+++ b/leaflet-indoor.js
@@ -168,6 +168,20 @@ L.Indoor = L.Class.extend({
}
this._level = level;
+ },
+ resetStyle: function (layer) {
+ // reset any custom styles
+ layer.options = layer.defaultOptions;
+ this._setLayerStyle(layer, this.options.style);
+ return this;
+ },
+ _setLayerStyle: function (layer, style) {
+ if (typeof style === 'function') {
+ style = style(layer.feature);
+ }
+ if (layer.setStyle) {
+ layer.setStyle(style);
+ }
}
});