kml

package
v0.0.0-...-0b7008c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2023 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AltitudeMode = [...]string{
	"clampToGround",
	"relativeToGround",
	"absolute",
	"clampToSeaFloor",
	"relativeToSeaFloor",
}

Functions

func NewCoordinates

func NewCoordinates(longitude, latitude, altitude float64) string

func NewCoordinatesOffset

func NewCoordinatesOffset(longitude, latitude float64) string

Types

type AltitudeModeKey

type AltitudeModeKey int
const (
	ClampToGround AltitudeModeKey = iota
	RelativeToGround
	Absolute
	ClampToSeaFloor
	RelativeToSeaFloor
)

type Description

type Description struct {
	Data string `xml:",cdata"`
}

type Document

type Document struct {
	Name      string      `xml:"name"`
	Style     Style       `xml:"Style"`
	Placemark []Placemark `xml:"Placemark"`
}

type Icon

type Icon struct {
	Href string `xml:"href,omitempty"`
}

type IconStyle

type IconStyle struct {
	Id    string  `xml:"id,attr,omitempty"`
	Icon  Icon    `xml:"Icon,omitempty"`
	Color string  `xml:"color,omitempty"`
	Scale float64 `xml:"scale,omitempty"`
}

type Kml

type Kml struct {
	XMLName       xml.Name `xml:"kml"`
	Namespace     string   `xml:"xmlns,attr"`
	AtomNamespace string   `xml:"xmlns:atom,attr"`
	GxNamespace   string   `xml:"xmlns:gx,attr"`
	KmlNamespace  string   `xml:"xmlns:kml,attr"`
	Document      Document `xml:"Document"`
}

Kml template

func NewKML

func NewKML(namespace string, numPlacemarks int) *Kml

func (*Kml) AddPlacemark

func (k *Kml) AddPlacemark(placemark Placemark)

func (*Kml) Marshal

func (k *Kml) Marshal() ([]byte, error)

type LabelStyle

type LabelStyle struct {
	Color string  `xml:"color,omitempty"`
	Scale float64 `xml:"scale,omitempty"`
}

type LineString

type LineString struct {
	Extrude      int    `xml:"extrude"`
	AltitudeMode string `xml:"altitudeMode"`
	Coordinates  string `xml:"coordinates"`
	Tessellate   int    `xml:"tessellate"`
}

linestring google template

func (*LineString) AddCoordinate

func (l *LineString) AddCoordinate(longitude float64, latitude float64, altitude float64)

type LineStyle

type LineStyle struct {
	Color string `xml:"color,omitempty"`
	Width int    `xml:"width,omitempty"`
}

type Placemark

type Placemark struct {
	Name        string       `xml:"name"`
	Description Description  `xml:"description"`
	StyleUrl    string       `xml:"styleUrl"`
	Style       Style        `xml:"Style,omitempty"`
	Point       Point        `xml:"Point,omitempty"`
	LineString  []LineString `xml:"LineString,omitempty"`
}

Placemark template

func (*Placemark) AddLineString

func (p *Placemark) AddLineString(lineString LineString)

type Point

type Point struct {
	AltitudeMode string `xml:"altitudeMode,omitempty"`
	Coordinates  string `xml:"coordinates"`
}

type Style

type Style struct {
	Id         string     `xml:"id,attr,omitempty"`
	IconStyle  IconStyle  `xml:"IconStyle,omitempty"`
	LabelStyle LabelStyle `xml:"LabelStyle,omitempty"`
	LineStyle  LineStyle  `xml:"LineStyle,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL