]> git.openstreetmap.org Git - rails.git/blobdiff - vendor/assets/leaflet/leaflet.js
Adjust header sizing
[rails.git] / vendor / assets / leaflet / leaflet.js
index 17fbc626bb6ee31558e28885711b3801eaeb34dc..0f0b01be2a587f901b9464cce071d2cc191529ba 100644 (file)
@@ -1704,7 +1704,7 @@ L.Map = L.Class.extend({
        removeLayer: function (layer) {
                var id = L.stamp(layer);
 
-               if (!this._layers[id]) { return; }
+               if (!this._layers[id]) { return this; }
 
                if (this._loaded) {
                        layer.onRemove(this);
@@ -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);
@@ -1772,11 +1773,7 @@ L.Map = L.Class.extend({
                                this._rawPanBy(offset);
                        }
 
-                       this.fire('move');
-
-                       // make sure moveend is not fired too often on resize
-                       clearTimeout(this._sizeTimer);
-                       this._sizeTimer = setTimeout(L.bind(this.fire, this, 'moveend'), 200);
+                       this.fire('move').fire('moveend');
                }
 
                return this.fire('resize', {
@@ -1825,7 +1822,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());