here

package module
v0.0.0-...-d390dda Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: MIT Imports: 14 Imported by: 0

README

go-here-map

Go service to communicate with here.com's Location Service v1.6 API

Grab your HERE Location Services REST API App ID and App Code here https://developer.here.com/projects

This service does not work with the following request parameters: apiKey bbox ctr e ectr ml2 poifc poilbl poithm poitxc poitxs pview ra rad,rad0,rad1,... scp token tx.xy,tx.xy0,tx.xy1,... txc txs txsc u

HERE API Resource Parameters

https://developer.here.com/documentation/map-image/dev_guide/topics/resource-map.html

Tests

HERE_MAP_APP_ID=<YOUR_APP_ID> HERE_MAP_APP_CODE=<YOUR_APP_CODE> go test -v -cover

coverage: 93.7% of statements

Check out some wonderful examples

Documentation

Index

Constants

View Source
const (
	HereMapViewBaseAPIURLv1 = "https://image.maps.api.here.com/mia/1.6/mapview"
)

Variables

This section is empty.

Functions

func Float64ToString

func Float64ToString(f float64) string

Types

type Address

type Address struct {
	Number  string `json:"number"`
	Street  string `json:"street"`
	City    string `json:"city"`
	ZipCode string `json:"zipcode"`
	Country string `json:"country"`
}

type Coordinates

type Coordinates struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type HereMap

type HereMap struct {
	AppID   string
	AppCode string
}

func NewHereMap

func NewHereMap(appId, appCode string) (*HereMap, error)

func (*HereMap) GetMap

func (h *HereMap) GetMap(request *Request) (image.Image, string, string, error)

type Label

type Label struct {
	Point      Coordinates `json:"point"`
	Label      string      `json:"label"`
	BgColor    string      `json:"bg_color"`
	LabelColor string      `json:"label_color"`
	Size       int         `json:"size"`
}

type Request

type Request struct {
	ScaleType         string        `json:"scale_type"`
	ViewType          int           `json:"view_type"`
	Point             Coordinates   `json:"point"`
	Center            Coordinates   `json:"center"`
	Address           Address       `json:"address"`
	ShowAddressInfo   bool          `json:"show_address_info"`
	Zoom              int           `json:"zoom"`
	Style             string        `json:"style"`
	PIP               int           `json:"pip"`
	POI               []Coordinates `json:"poi"`
	POILabel          []Label       `json:"poi_label"`
	PPI               int           `json:"ppi"`
	TextLabel         []Label       `json:"text_label"`
	FileType          string        `json:"file_type"`
	Width             int           `json:"width"`
	Height            int           `json:"height"`
	Terrain           int           `json:"terrain"`
	HideCompass       bool          `json:"hide_compass"`
	HideCopyright     bool          `json:"hide_copyright"`
	HideCenterDot     bool          `json:"hide_center_dot"`
	HideMarkers       int           `json:"hide_markers"`
	NoCroppedLabels   bool          `json:"no_cropped_labels"`
	JpegQuality       int           `json:"jpeg_quality"`
	MaxHits           int           `json:"max_hits"`
	Language          string        `json:"language"`
	UncertaintyRadius int           `json:"uncertainty_radius"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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