]> git.openstreetmap.org Git - rails.git/commitdiff
Port fix for Leaflet issue #1919
authorJohn Firebaugh <john.firebaugh@gmail.com>
Mon, 5 Aug 2013 21:30:50 +0000 (14:30 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Mon, 5 Aug 2013 21:30:50 +0000 (14:30 -0700)
vendor/assets/leaflet/leaflet.js

index 17fbc626bb6ee31558e28885711b3801eaeb34dc..b972941d97a06cbb5705ce998d7382fa682e355c 100644 (file)
@@ -1752,6 +1752,7 @@ L.Map = L.Class.extend({
 
                var oldSize = this.getSize();
                this._sizeChanged = true;
+               this._initialCenter = null;
 
                if (this.options.maxBounds) {
                        this.setMaxBounds(this.options.maxBounds);
@@ -1825,7 +1826,7 @@ L.Map = L.Class.extend({
        getCenter: function () { // (Boolean) -> LatLng
                this._checkIfLoaded();
 
-               if (!this._moved()) {
+               if (this._initialCenter && !this._moved()) {
                        return this._initialCenter;
                }
                return this.layerPointToLatLng(this._getCenterLayerPoint());