nodetiles / nodetiles-core

Render Leaflet compatible map tiles and UTFGrids using node-canvas on Heroku
BSD 3-Clause "New" or "Revised" License
47 stars 22 forks source link

Customizable buffer sizes for rendered data #76

Closed Mr0grog closed 10 years ago

Mr0grog commented 10 years ago

Right now, the Map object 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:

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.

Mr0grog commented 10 years ago

How does this seem to you, @prashtx, @hampelm?

prashtx commented 10 years ago

Nice! This looks good to me.

hampelm commented 10 years ago

Looks great. Thanks!

Mr0grog commented 10 years ago

Great, will bump versions and merge this in, then.