Documentation
¶
Overview ¶
Package geojson2svg provides the SVG type to convert geojson geometries, features and featurecollections into a SVG image.
See the tests for usage examples.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*SVG)
An Option represents a single SVG option.
func UseProperties ¶
UseProperties configures which geojson properties should be copied to the resulting SVG element.
func WithAttribute ¶
WithAttribute adds the key value pair as attribute to the resulting SVG root element.
func WithAttributes ¶
WithAttributes adds the map of key value pairs as attributes to the resulting SVG root element.
func WithPadding ¶
WithPadding configures the SVG to use the specified padding.
type Padding ¶
type Padding struct{ Top, Right, Bottom, Left float64 }
Padding represents the possible padding of the SVG.
type SVG ¶
type SVG struct { Mercator bool Extent *Extent Debug bool // contains filtered or unexported fields }
SVG represents the SVG that should be created. Use the New function to create a SVG. New will handle the defaualt values.
default padding (top: 0, right: 0, bottom: 0, left: 0)
default properties (class)
default attributes ()
func New ¶
func New() *SVG
New returns a new SVG that can be used to to draw geojson geometries, features and featurecollections.
func (*SVG) AddFeature ¶
AddFeature adds a geojson feature to the svg.
func (*SVG) AddFeatureCollection ¶
AddFeatureCollection adds a geojson featurecollection to the svg.
func (*SVG) AddGeometry ¶
AddGeometry adds a geojson geometry to the svg.