Skip to main content

amap

函数名函数描述/介绍
amap.GetBicyclingPlan
amap.GetDistance
amap.GetDrivingPlan
amap.GetGeocode
amap.GetIpLocationIPLocation locates an IP address or the requester's IP if ip is empty
amap.GetNearbyPOISearchNearbyPOI provides simplified location-based POI search
amap.GetPOISearchPOI provides simplified keyword-based POI search
amap.GetPOIDetailGetPOIDetail provides simplified POI detail lookup by ID
amap.GetReverseGeocode
amap.GetTransitPlan
amap.GetWalkingPlan
amap.GetWeather
amap.apiKeyWithApiKey sets the API key in the config.
amap.baseURLWithBaseURL sets the base URL in the config.
amap.cityWithCity sets the city for API requests
amap.extensionsWithExtensions sets the extensions parameter (base or all)
amap.geocodeFilterWithGeocodeFilter sets the geocode filter for the Amap API client.
amap.pageWithPage sets the page number for paginated results
amap.pageSizeWithPageSize sets the page size for paginated results
amap.pocOptsWithLowhttpOptions sets the lowhttp options for the Amap API client.
amap.radiusWithRadius sets the radius for nearby searches
amap.sortRuleWithSortRule sets the sort rule for search results
amap.timeoutWithTimeout sets the HTTP client timeout in the config.
amap.typeWithType sets the type parameter for distance calculations

函数定义#

GetBicyclingPlan#

详细描述#

定义#

GetBicyclingPlan(origin string, destination string, options ...AmapConfigOption) (*BicyclingResult, error)

参数#

参数名参数类型参数解释
originstring
destinationstring
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1*BicyclingResult
r2error

GetDistance#

详细描述#

定义#

GetDistance(origin string, destination string, options ...AmapConfigOption) (*DistanceResult, error)

参数#

参数名参数类型参数解释
originstring
destinationstring
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1*DistanceResult
r2error

GetDrivingPlan#

详细描述#

定义#

GetDrivingPlan(origin string, destination string, options ...AmapConfigOption) (*DirectionResponse, error)

参数#

参数名参数类型参数解释
originstring
destinationstring
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1*DirectionResponse
r2error

GetGeocode#

详细描述#

定义#

GetGeocode(address string, options ...AmapConfigOption) ([]*GeocodeResult, error)

参数#

参数名参数类型参数解释
addressstring
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1[]*GeocodeResult
r2error

GetIpLocation#

详细描述#

IPLocation locates an IP address or the requester's IP if ip is empty

定义#

GetIpLocation(ip string, options ...AmapConfigOption) (*IPLocationResultEx, error)

参数#

参数名参数类型参数解释
ipstring
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1*IPLocationResultEx
r2error

GetNearbyPOI#

详细描述#

SearchNearbyPOI provides simplified location-based POI search

定义#

GetNearbyPOI(location string, keywords string, options ...AmapConfigOption) (*SearchPOIResultEx, error)

参数#

参数名参数类型参数解释
locationstring
keywordsstring
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1*SearchPOIResultEx
r2error

GetPOI#

详细描述#

SearchPOI provides simplified keyword-based POI search

定义#

GetPOI(keywords string, options ...AmapConfigOption) (*SearchPOIResultEx, error)

参数#

参数名参数类型参数解释
keywordsstring
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1*SearchPOIResultEx
r2error

GetPOIDetail#

详细描述#

GetPOIDetail provides simplified POI detail lookup by ID

定义#

GetPOIDetail(poiID string, options ...AmapConfigOption) (*POIResultEx, error)

参数#

参数名参数类型参数解释
poiIDstring
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1*POIResultEx
r2error

GetReverseGeocode#

详细描述#

定义#

GetReverseGeocode(longitude float64, latitude float64, options ...AmapConfigOption) (*RegeoCodeResult, error)

参数#

参数名参数类型参数解释
longitudefloat64
latitudefloat64
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1*RegeoCodeResult
r2error

GetTransitPlan#

详细描述#

定义#

GetTransitPlan(origin string, destination string, options ...AmapConfigOption) (*TransitResponse, error)

参数#

参数名参数类型参数解释
originstring
destinationstring
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1*TransitResponse
r2error

GetWalkingPlan#

详细描述#

定义#

GetWalkingPlan(origin string, destination string, options ...AmapConfigOption) (*V5WalkingResponse, error)

参数#

参数名参数类型参数解释
originstring
destinationstring
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1*V5WalkingResponse
r2error

GetWeather#

详细描述#

定义#

GetWeather(cityCode string, options ...AmapConfigOption) (*WeatherResponse, error)

参数#

参数名参数类型参数解释
cityCodestring
options...AmapConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1*WeatherResponse
r2error

apiKey#

详细描述#

WithApiKey sets the API key in the config.

定义#

apiKey(apiKey string) AmapConfigOption

参数#

参数名参数类型参数解释
apiKeystring

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption

baseURL#

详细描述#

WithBaseURL sets the base URL in the config.

定义#

baseURL(baseURL string) AmapConfigOption

参数#

参数名参数类型参数解释
baseURLstring

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption

city#

详细描述#

WithCity sets the city for API requests

定义#

city(city string) AmapConfigOption

参数#

参数名参数类型参数解释
citystring

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption

extensions#

详细描述#

WithExtensions sets the extensions parameter (base or all)

定义#

extensions(extensions string) AmapConfigOption

参数#

参数名参数类型参数解释
extensionsstring

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption

geocodeFilter#

详细描述#

WithGeocodeFilter sets the geocode filter for the Amap API client.

定义#

geocodeFilter(filter func(geocodes []*GeocodeResult) *GeocodeResult) AmapConfigOption

参数#

参数名参数类型参数解释
filterfunc(geocodes []*GeocodeResult) *GeocodeResult

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption

page#

详细描述#

WithPage sets the page number for paginated results

定义#

page(page int) AmapConfigOption

参数#

参数名参数类型参数解释
pageint

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption

pageSize#

详细描述#

WithPageSize sets the page size for paginated results

定义#

pageSize(pageSize int) AmapConfigOption

参数#

参数名参数类型参数解释
pageSizeint

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption

pocOpts#

详细描述#

WithLowhttpOptions sets the lowhttp options for the Amap API client.

定义#

pocOpts(opts ...poc.PocConfigOption) AmapConfigOption

参数#

参数名参数类型参数解释
opts...poc.PocConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption

radius#

详细描述#

WithRadius sets the radius for nearby searches

定义#

radius(radius int) AmapConfigOption

参数#

参数名参数类型参数解释
radiusint

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption

sortRule#

详细描述#

WithSortRule sets the sort rule for search results

定义#

sortRule(sortRule string) AmapConfigOption

参数#

参数名参数类型参数解释
sortRulestring

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption

timeout#

详细描述#

WithTimeout sets the HTTP client timeout in the config.

定义#

timeout(timeout time.Duration) AmapConfigOption

参数#

参数名参数类型参数解释
timeouttime.Duration

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption

type#

详细描述#

WithType sets the type parameter for distance calculations

定义#

type(typ string) AmapConfigOption

参数#

参数名参数类型参数解释
typstring

返回值#

返回值(顺序)返回值类型返回值解释
r1AmapConfigOption