coord

package
v0.27.4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package coord contains a function to get the coordinates of a human-readable address, using GMaps.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound       = errors.New("not found")
	ErrTooManyResults = errors.New("too many results")

	// APIKey is the API_KEY served too Google Maps services.
	// It is set by default to the contents of the GOOGLE_MAPS_API_KEY env var.
	APIKey = os.Getenv("GOOGLE_MAPS_API_KEY")
)
View Source
var (
	Log = func(...interface{}) error { return nil }

	DefaultTitle   = "Cím koordináták pontosítása"
	DefaultAddress = "Budapest"
)

Functions

This section is empty.

Types

type Interactive

type Interactive struct {
	Set            func(id string, loc Location) error
	Title          string
	DefaultAddress string
	BaseURL        string
	MapCenter      Location
	Location       Location

	NoDirect bool
	// contains filtered or unexported fields
}

func (*Interactive) RenderHTML

func (in *Interactive) RenderHTML(w io.Writer, address, callbackURL string) error

func (*Interactive) ServeHTTP

func (in *Interactive) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Location

type Location struct {
	Address string
	Lat     float64 `json:"lat"`
	Lng     float64 `json:"lng"`
}

func Get

func Get(ctx context.Context, address string) (Location, error)

Jump to

Keyboard shortcuts

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