Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

offset lines

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 site First June 11, 2013
Octocat-spinner-32 test
Octocat-spinner-32 visual
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.md
Octocat-spinner-32 index.html
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
README.md

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.

Something went wrong with that request. Please try again.