tenxunloc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdInfo

type AdInfo struct {
	Adcode string `json:"adcode,omitempty"`
}

type AddressComponents

type AddressComponents struct {
	Province     string `json:"province,omitempty"`
	City         string `json:"city,omitempty"`
	District     string `json:"district,omitempty"`
	Street       string `json:"street,omitempty"`
	StreetNumber string `json:"street_number,omitempty"`
}

type Element

type Element struct {
	Distance int `json:"distance,omitempty"`
	Duration int `json:"duration,omitempty"`
}

type Location

type Location struct {
	Lat float64 `json:"lat,omitempty"`
	Lng float64 `json:"lng,omitempty"`
}

type RespGeoDistance

type RespGeoDistance struct {
	Status  int               `json:"status,omitempty"`
	Message string            `json:"message,omitempty"`
	Result  ResultGeoDistance `json:"result,omitempty"`
}

func GeoDistance

func GeoDistance(mode, from, to, accessKey, secretKey string) (rsp RespGeoDistance, err error)

Address2Geo 腾讯位置服务-地址解析(地址转坐标)

mode 模式: driving-驾车 walking-步行 bicycling-自行车

from 起点经纬度,逗号分隔

to 终点经纬度,逗号分隔

accessKey 访问Key

secretKey 访问密钥

type RespLoc

type RespLoc struct {
	Status  int       `json:"status,omitempty"`
	Message string    `json:"message,omitempty"`
	Result  ResultLoc `json:"result,omitempty"`
}

func Address2Geo

func Address2Geo(address, accessKey, secretKey string) (rsp RespLoc, err error)

Address2Geo 腾讯位置服务-地址解析(地址转坐标)

address 地址

accessKey 访问Key

secretKey 访问密钥

type ResultGeoDistance

type ResultGeoDistance struct {
	Rows []Row `json:"rows,omitempty"`
}

type ResultLoc

type ResultLoc struct {
	Title             string            `json:"title,omitempty"`
	Location          Location          `json:"location,omitempty"`
	AddressComponents AddressComponents `json:"address_components,omitempty"`
	AdInfo            AdInfo            `json:"ad_info,omitempty"`
	Reliability       int               `json:"reliability,omitempty"`
	Level             int               `json:"level,omitempty"`
}

type Row

type Row struct {
	Elements []Element `json:"elements,omitempty"`
}

Jump to

Keyboard shortcuts

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