Pan the two maps below and observe that the blank background underneath the tiles is less likely to be seen when using the EdgeBuffer plugin.

Without EdgeBuffer

Standard EdgeBuffer Usage (1 Tile)


Add the script to your document. E.g.

<script src="./leaflet.edgebuffer.js"></script>

Add the edgeBufferTiles property to your tiled map layers (or any L.GridLayer-based layer). The value is the minimum number of tiles to load outside of the visible area. Fractional values are permitted. E.g.

var openStreetMap = L.tileLayer('http://{s}{z}/{x}/{y}.png', {
  edgeBufferTiles: 1

See for the code and to download.