Documentation ¶
Overview ¶
A KML library with Google KML extensions
Index ¶
Constants ¶
const (
DefaultNamespace = "http://www.opengis.net/kml/2.2"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomAuthor ¶
type AtomAuthor struct { XMLName xml.Name `xml:"http://www.w3.org/2005/Atom author"` Name string `xml:"name,omitempty"` }
* Container type Atom Author
func NewAtomAuthor ¶
func NewAtomAuthor(name string) AtomAuthor
NewAtomAuthor() creates a new atom authro
type Color ¶
type Color struct {
// contains filtered or unexported fields
}
func NewColorHSLA ¶
func NewColorRGBA ¶
type Data ¶
type Data struct { XMLName xml.Name `xml:"Data"` Name string `xml:"name,attr"` Value string `xml:"value"` }
Data that goes in ExtendedData
type Document ¶
type Document struct { XMLName xml.Name `xml:"Document"` Id string `xml:"id,attr,omitempty"` Name string `xml:"name,omitempty"` Visibility int `xml:"visibility,omitempty"` Open int `xml:"open,omitempty"` AtomAuthor AtomAuthor `xml:"http://www.w3.org/2005/Atom author,omitempty"` Address string `xml:"address,omitempty"` PhoneNumber string `xml:"phoneNumber,omitempty"` Description string `xml:"description,omitempty"` Schema []Schema `xml:"Schema"` DocStyle []Style `xml:"Style"` Placemarks []Placemark `xml:"Placemark"` Folders []Folder `xml:"Folder"` Elements []interface{} }
* Container type Document
func (*Document) AddElement ¶
AddElement() adds a path to the document
func (*Document) AddPlacemark ¶
AddPlacemark() adds a placemark to the document
type ExtendedData ¶
ExtendedData for placemarks
func NewExtendedData ¶
func NewExtendedData() ExtendedData
NewExtendedData() creates new extended data
func (*ExtendedData) AddData ¶
func (e *ExtendedData) AddData(name, value string)
AddData() adds data of {name, value} to the ExtendedData structure
type Folder ¶
type Folder struct { XMLName xml.Name `xml:"Folder"` Id string `xml:"id,attr,omitempty"` Name string `xml:"name,omitempty"` Visibility int `xml:"visibility,omitempty"` Open int `xml:"open,omitempty"` Address string `xml:"address,omitempty"` PhoneNumber string `xml:"phoneNumber,omitempty"` Description string `xml:"description,omitempty"` Placemarks []Placemark `xml:"Placemark"` Folders []Folder `xml:"Folder"` Elements []interface{} }
* Container type Folder
func (*Folder) AddElement ¶
func (f *Folder) AddElement(e interface{})
AddElement() adds a path to the document
func (*Folder) AddPlacemark ¶
AddPlacemark() adds a placemark to the folder
func (*Folder) SetVisibility ¶
SetVisibility() sets the visibility of the folder
type GxSimpleArrayField ¶
type IconStyle ¶
type IconStyle struct { XMLName xml.Name `xml:"IconStyle"` Scale string `xml:"scale,omitempty"` Heading string `xml:"heading,omitempty"` Href string `xml:"Icon>href,omitempty"` }
IconStyle
func NewIconStyle ¶
type Kml ¶
type Kml struct { XMLName xml.Name `xml:"kml"` Namespace string `xml:"xmlns,attr"` Document Document `xml:"Document"` Placemarks []Placemark `xml:"Placemark"` Folders []Folder `xml:"Folder"` Elements []Element }
Kml is the base Kml document
func JsonUnmarshal ¶
JSON Unmarshal() returns a kml struct unmarshalled from the provided byte array
func (*Kml) AddDocument ¶
AddDocument() adds a document to the kml structure
func (*Kml) AddElement ¶
AddElement() adds a path to the document
func (*Kml) AddPlacemark ¶
AddPlacemark() adds a placemark to the document
func (*Kml) JsonMarshal ¶
JSON Marshal() returns a properly indented XML structure
type LineStyle ¶
type LineStyle struct { XMLName xml.Name `xml:"LineStyle"` Color string `xml:"color,omitempty"` Width string `xml:"width,omitempty"` }
LineStyle
func NewLineStyle ¶
type Path ¶
type Path struct { XMLName xml.Name `xml:"Placemark"` Id string `xml:"id,attr,omitempty"` Name string `xml:"name,omitempty"` Description string `xml:"description,omitempty"` StyleUrl string `xml:"styleUrl,omitempty"` Coordinates string `xml:"LineString>coordinates"` Extended ExtendedData `xml:"ExtendedData"` Style Style `xml:",omitempty"` TimeStamp string `xml:"TimeStamp,omitempty"` }
* Path
func (*Path) AddCoordinates ¶
AddCoordinates takes latitude, longitude, and altitude and adds the Coordinate value to the path
func (*Path) AddExtendedData ¶
func (p *Path) AddExtendedData(e ExtendedData)
AddExtendedData() adds an ExtendedData structure to the Path
func (*Path) SetCoordinates ¶
SetCoordinates takes latitude, longitude, and altitude and sets the Coordinates value of the Path.
type Placemark ¶
type Placemark struct { XMLName xml.Name `xml:"Placemark"` Id string `xml:"id,attr,omitempty"` Name string `xml:"name,omitempty"` Description string `xml:"description,omitempty"` StyleUrl string `xml:"styleUrl,omitempty"` Coordinates string `xml:"Point>coordinates"` Extended ExtendedData `xml:"ExtendedData"` }
* Placemark
func NewPlacemark ¶
NewPlacemark() creates a new placemark. All parameters are strings.
func (*Placemark) AddExtendedData ¶
func (p *Placemark) AddExtendedData(e ExtendedData)
AddExtendedData() adds an ExtendedData structure to the Placemark
func (*Placemark) SetCoordinates ¶
SetCoordinates takes latitude, longitude, and altitude and sets the Coordinates value of the Placemark.