(function(previousMethods){

if (typeof previousMethods === 'undefined') {
	// Defining previously that object allows you to use that plugin even if you have overridden L.map
	previousMethods = {
		_pxBoundsToTileRange: L.GridLayer.prototype._pxBoundsToTileRange
	};
}

L.GridLayer.include({
  _pxBoundsToTileRange: function (bounds) {
    var tileRange = previousMethods._pxBoundsToTileRange.apply(this, arguments);
    
    // Default is to not buffer edge tiles (edgeBufferTiles = 0).
    var edgeBufferTiles = this.options.edgeBufferTiles || 0;

    return new L.Bounds(
      tileRange.min.subtract([edgeBufferTiles, edgeBufferTiles]),
      tileRange.max.add([edgeBufferTiles, edgeBufferTiles]));
  }
});

})(window.leafletEdgeBufferPreviousMethods);

(function(previousMethods){

if (typeof previousMethods === 'undefined') {
	// Defining previously that object allows you to use that plugin even if you have overridden L.map
	previousMethods = {
		getTiledPixelBounds: L.GridLayer.prototype._getTiledPixelBounds
	};
}

L.GridLayer.include({

  _getTiledPixelBounds : function(center, zoom, tileZoom) {
    var pixelBounds = previousMethods.getTiledPixelBounds.call(this, center, zoom, tileZoom);
    
    if (this.options.edgeBufferTiles > 0) {
      var pixelEdgeBuffer = this.options.edgeBufferTiles * this._getTileSize();
      pixelBounds = new L.Bounds(pixelBounds.min.subtract([pixelEdgeBuffer, pixelEdgeBuffer]), pixelBounds.max.add([pixelEdgeBuffer, pixelEdgeBuffer]));
    }
    
    return pixelBounds;
  }
});

})(window.leafletEdgeBufferPreviousMethods);

Revert "Override `_pxBoundsToTileRange` instead of `_getTiledPixelBounds`."
Revert "Override `_pxBoundsToTileRange` instead of  `_getTiledPixelBounds`."

This reverts commit 89edebf902a9d5024da5388f3c9df174e263c99e.
