Don't call updateLayers if the new state has no layer config

Fixes #719
This commit is contained in:
Tom Hughes 2014-03-13 21:36:10 +00:00
parent 82ff8ef58d
commit 24e22dde6e

View file

@ -241,7 +241,7 @@ L.OSM.Map = L.Map.extend({
setState: function(state, options) {
if (state.center) this.setView(state.center, state.zoom, options);
this.updateLayers(state.layers);
if (state.layers) this.updateLayers(state.layers);
}
});