amap

package
v0.0.0-...-74f83c4 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 地理编码服务
	GeocoderUrl = "https://restapi.amap.com/v3/geocode/geo?parameters"
	// 全球逆地理编码服务Url
	ReverseGeocodingUrl = "https://restapi.amap.com/v3/geocode/regeo?parameters"
	// 普通IP定位
	IPLocationUrl = "https://restapi.amap.com/v3/ip?parameters"
	// 智能硬件定位
	LBSLocationUrl = "http://apilocate.amap.com/position"
	// 天气
	WeatherUrl = "https://restapi.amap.com/v3/weather/weatherInfo?parameters"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AMapSDK

type AMapSDK struct {
	// contains filtered or unexported fields
}

func DefaultAMapSDK

func DefaultAMapSDK(key string) *AMapSDK

func NewAMapSDK

func NewAMapSDK(key, output string) *AMapSDK

func (AMapSDK) Geocoder

func (s AMapSDK) Geocoder(address string, city string) (*ls.Location, error)

func (AMapSDK) GeocoderParams

func (s AMapSDK) GeocoderParams(params url.Values) (*ls.Location, error)

func (AMapSDK) GetWeatherNow

func (s AMapSDK) GetWeatherNow(adcode int64) (*ls.WeatherInfo, error)

func (AMapSDK) IPLocation

func (s AMapSDK) IPLocation(ip string) (*ls.IPPosition, error)

func (AMapSDK) IPLocationParams

func (s AMapSDK) IPLocationParams(params url.Values) (*ls.IPPosition, error)

func (AMapSDK) LBSLocation

func (s AMapSDK) LBSLocation(req *ls.LBSInfo) (*ls.LBSPosition, error)

func (AMapSDK) LBSLocationParams

func (s AMapSDK) LBSLocationParams(params url.Values) (*ls.LBSPosition, error)

func (AMapSDK) ReverseGeocoding

func (s AMapSDK) ReverseGeocoding(lng, lat float64) (*ls.Address, error)

func (AMapSDK) ReverseGeocodingParams

func (s AMapSDK) ReverseGeocodingParams(params url.Values) (*ls.Address, error)

type Geocode

type Geocode struct {
	FormattedAddress string      `json:"formatted_address"` // 结构化地址信息
	Province         interface{} `json:"province"`          // 省名
	City             interface{} `json:"city"`              // 城市名
	District         interface{} `json:"district"`          // 区县名
	Street           interface{} `json:"street"`            // 街道名
	StreetNumber     interface{} `json:"number"`            // 街道门牌号
	AdCode           string      `json:"adcode"`            // 行政区划代码
	Location         string      `json:"location"`          // 坐标点
}

type GeocoderRes

type GeocoderRes struct {
	Status   string     `json:"status"`   // 返回结果状态值, 成功返回0,其他值请查看下方返回码状态表。
	Msg      string     `json:"info"`     // 错误消息
	Geocodes []*Geocode `json:"geocodes"` // data数据
}

type IPLocationRes

type IPLocationRes struct {
	Status   string `json:"status"`   // 返回结果状态值, 成功返回0,其他值请查看下方返回码状态表。	int
	Msg      string `json:"info"`     // 错误消息
	Province string `json:"province"` // 省名
	City     string `json:"city"`     // 城市名
}

type LBSLocationRes

type LBSLocationRes struct {
	Status string `json:"status"` // 返回结果状态值, 成功返回0,其他值请查看下方返回码状态表。	int
	Msg    string `json:"info"`   // 错误消息
	Result result `json:"result"`
}

type Live

type Live struct {
	Province      string `json:"province"`
	City          string `json:"city"`
	Adcode        string `json:"adcode"`
	Weather       string `json:"weather"`
	Temperature   string `json:"temperature"`
	WindDirection string `json:"winddirection"`
	WindPower     string `json:"windpower"`
	Humidity      string `json:"humidity"`
	ReportTime    string `json:"reporttime"`
}

type ReverseGeocodingRes

type ReverseGeocodingRes struct {
	Status     string    `json:"status"`    // 返回结果状态值, 成功返回0,其他值请查看下方返回码状态表。	int
	Msg        string    `json:"info"`      // 错误消息
	Regeocodes regeocode `json:"regeocode"` //逆地理编码列表
}

type WeatherResponse

type WeatherResponse struct {
	Status   string `json:"status"`   // 返回状态 值为0或1 1:成功;0:失败
	Count    string `json:"count"`    // 返回结果总数目
	Info     string `json:"info"`     // 返回的状态信息
	InfoCode string `json:"infocode"` // 返回状态说明,10000代表正确
	Lives    []Live `json:"lives"`    // 实况天气数据信息
}

Jump to

Keyboard shortcuts

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