nodetiles/nodetiles-core — pull request #76 by Mr0grog (2014-04-04 03:25:48+00:00)
Title: Customizable buffer sizes for rendered data

Right now, the Map objects always adds a 25% buffer to the data requested/rendered for each call to `Map.render()`. This is done to ensure that elements whose strict data doesn't overlap tiles but whose rendering *does* (e.g. a really fat line stroke, a large image or shield, or some long text) doesn't wind up getting visually cut off at the edge of a tile.

This is a nice convenience, but in many cases, it would be useful to be able to customize the size of the buffer area or to turn off buffering altogether (see #75). To that end, this patch adds a `boundsBuffer` option to both the `Map` constructor and to `Map.render()/Map.renderGrid()`.

It can be:
- A number, used as a ratio of the requested image width. e.g. `0.25` means add a buffer that is 25% of the width of the rendered image.
- A function, which will be passed the requested bounds as an object and should return new bounds.

The option passed into `render()` will be preferred over the value set on the `Map` object. If no value is ever set, it will still default to `0.25`.