Merge pull request #302 from giscloud/invalidatesize.fix

don't proceed with invalidation if map is not loaded
This commit is contained in:
Vladimir Agafonkin 2011-09-19 23:43:31 -07:00
commit 149437a422

View File

@ -177,6 +177,8 @@ L.Map = L.Class.extend({
}, },
invalidateSize: function() { invalidateSize: function() {
if (!this._loaded) return this;
var oldSize = this.getSize(); var oldSize = this.getSize();
this._sizeChanged = true; this._sizeChanged = true;
this._rawPanBy(oldSize.subtract(this.getSize()).divideBy(2)); this._rawPanBy(oldSize.subtract(this.getSize()).divideBy(2));