imagemap

package
v0.0.0-...-48663ca Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromXML

func FromXML(m *XML) (kb.Item, error)

func New

func New(id string, image string, size Point, areas []Area) kb.Item

Types

type Area

type Area struct {
	Id  string `json:"id"`
	Alt string `json:"alt,omitempty"`
	Min Point  `json:"min"`
	Max Point  `json:"max"`
}

type Point

type Point struct {
	X int `json:"x"`
	Y int `json:"y"`
}

type XML

type XML struct {
	Image struct {
		Href string `xml:"href,attr"`
	} `xml:"image"`
	Area []XMLArea `xml:"area"`
}

type XMLArea

type XMLArea struct {
	Shape  string `xml:"shape"`
	Coords string `xml:"coords"`
	XRef   struct {
		Href string `xml:"href,attr"`
		Alt  string `xml:",chardata"`
	} `xml:"xref"`
}

Jump to

Keyboard shortcuts

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