From 252df33fe1186d5d3bf2009975fba3371db1fde6 Mon Sep 17 00:00:00 2001 From: tsukumaru Date: Tue, 12 Dec 2017 13:26:34 +0900 Subject: [PATCH] add NewPath func --- path.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/path.go b/path.go index e9758e4..edd8efb 100644 --- a/path.go +++ b/path.go @@ -24,6 +24,16 @@ type Path struct { Weight float64 } +// NewPath creates a new Path +func NewPath(positions []s2.LatLng, col color.Color, weight float64) *Path { + p := new(Path) + p.Positions = positions + p.Color = col + p.Weight = weight + + return p +} + // ParsePathString parses a string and returns a path func ParsePathString(s string) ([]*Path, error) { paths := make([]*Path, 0, 0)