Merge pull request #4089 from Leaflet/always-reset-enforcing-bounds

Make sure to always reset _enforcingBounds.
This commit is contained in:
Yohan Boniface 2015-12-28 16:43:00 +01:00
commit 748ae5338f

View File

@ -180,9 +180,10 @@ L.Map = L.Evented.extend({
var center = this.getCenter(),
newCenter = this._limitCenter(center, this._zoom, L.latLngBounds(bounds));
if (center.equals(newCenter)) { return this; }
if (!center.equals(newCenter)) {
this.panTo(newCenter, options);
}
this.panTo(newCenter, options);
this._enforcingBounds = false;
return this;
},