line-offset

0.0.0 • Public • Published

line-offset

Intelligently offset lines. Useful for a variety of problems, mainly map symbology, label placement, and drawing.

example

var line = [
    { x: 0, y: 10 },
    { x: 0, y: 20 },
    { x: 10, y: 20 },
    { x: 10, y: 27 }
];
 
var offsetLine = offset.offset(line, 10);

API

offset.offset(line, offset)

Offset a line by a certain distance. By default, expects points on the line to be in { x: 0, y: 0 } form. Offset is a required parameter and must be numeric.

Cheers

Mostly a port of includes/mapnik/offset_converter.hpp from the Mapnik project, though unlike it, a sync interface rather than a stream.

Readme

Keywords

none

Package Sidebar

Install

npm i line-offset

Weekly Downloads

2

Version

0.0.0

License

BSD

Last publish

Collaborators

  • tmcw