mapview

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	Up      key.Binding
	Right   key.Binding
	Down    key.Binding
	Left    key.Binding
	ZoomIn  key.Binding
	ZoomOut key.Binding
}

func DefaultKeyMap

func DefaultKeyMap() KeyMap

type MapCoordinates

type MapCoordinates struct {
	Lat float64
	Lng float64
	Err error
}

type MapRender

type MapRender string

type Model

type Model struct {
	Width  int
	Height int
	KeyMap KeyMap

	Style lipgloss.Style
	// contains filtered or unexported fields
}

func New

func New(width, height int) (m Model)

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) SetLatLng

func (m *Model) SetLatLng(lat float64, lng float64, zoom int)

func (*Model) SetLocation

func (m *Model) SetLocation(loc string, zoom int)

func (*Model) SetStyle added in v0.2.0

func (m *Model) SetStyle(style Style)

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type NominatimResponse

type NominatimResponse []struct {
	PlaceID     int    `json:"place_id"`
	License     string `json:"license"`
	OSMType     string `json:"osm_type"`
	OSMID       int    `json:"osm_id"`
	Lat         string `json:"lat"`
	Lon         string `json:"lon"`
	DisplayName string `json:"display_name"`
}

type Style added in v0.2.0

type Style int8
const (
	Wikimedia Style = iota
	OpenStreetMaps
	OpenTopoMap
	OpenCycleMap
	CartoLight
	CartoDark
	StamenToner
	StamenTerrain
	ThunderforestLandscape
	ThunderforestOutdoors
	ThunderforestTransport
	ArcgisWorldImagery
)

Jump to

Keyboard shortcuts

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