目录

QuerySuggestionRequest

Class Info

public class QuerySuggestionRequest

查询建议的请求对象。

Public Constructor Summary

Constructor Name

QuerySuggestionRequest()

默认的构造方法。

Public Method Summary

Qualifier and Type

Method Name and Description

CoordinateBounds

getBounds()

获取到搜索结果偏向的范围。

String

getCountryCode()

获取到地点的国家/地区码。

String

getLanguage()

获取用于查询地点搜索建议结果的语种。

Coordinate

getLocation()

获取到搜索结果偏向的经纬度。

List<LocationType>

getPoiTypes()

获取返回地点的POI类型。

String

getPoliticalView()

获取政治观点。

注意:

该接口已废弃。

String

getQuery()

获取到搜索关键字。

Integer

getRadius()

获取到搜索半径。

boolean

isChildren()

判断是否查询子节点。

Boolean

getStrictBounds()

获取到是否严格限制在Bounds内搜索。

List<String>

getCountries()

获取当前设置的多个国家码。

void

setChildren(boolean children)

设置是否返回子节点。

void

setBounds(CoordinateBounds bounds)

设置搜索结果偏向的范围。

void

setCountryCode(String countryCode)

设置国家/地区码。

void

setLanguage(String language)

设置搜索结果的语种。

void

setLocation(Coordinate location)

设置搜索结果偏向的经纬度。

void

setPoiTypes(List<LocationType> poiTypes)

设置返回地点的POI类型。

void

setPoliticalView(String politicalView)

设置政治观点。

注意:

该接口已废弃。

void

setQuery(String query)

设置搜索关键字。

void

setRadius(Integer radius)

设置搜索半径。

void

setStrictBounds(Boolean strictBounds)

设置是否严格限制在Bounds内搜索。

void

setCountries(List<String> countries)

设置多个国家码。

Public Methods

[h2]getBounds

Method

public CoordinateBounds getBounds()

您调用此API可以获取到搜索结果偏向的范围。

Returns

Type

Description

CoordinateBounds

搜索结果偏向的范围。

[h2]getCountryCode

Method

public String getCountryCode()

您调用此API可以获取到地点的国家/地区码。

Returns

Type

Description

String

国家/地区码,在指定的国家内搜索,采用ISO 3166-1 alpha-2。

[h2]getLanguage

Method

public String getLanguage()

您调用此API可以获取用于查询地点搜索建议结果的语种。

Returns

Type

Description

String

用于查询地点搜索建议结果的语种。

[h2]getLocation

Method

public Coordinate getLocation()

您调用此API可以获取到搜索结果偏向的经纬度。

Returns

Type

Description

Coordinate

搜索结果偏向的经纬度。

[h2]getPoiTypes

Method

public List<LocationType> getPoiTypes()

您调用此API可以获取返回地点的POI类型。

Returns

Type

Description

List<LocationType>

地点的POI类型。

[h2]getPoliticalView

该接口已废弃。

Method

public String getPoliticalView()

您调用此API可以获取政治观点。

Returns

Type

Description

String

政治观点。

[h2]getQuery

Method

public String getQuery()

您调用此API可以获取到搜索关键字。

Returns

Type

Description

String

搜索关键字。

[h2]getRadius

Method

public Integer getRadius()

您调用此API可以获取到搜索半径。

Returns

Type

Description

Integer

搜索半径,单位:米。

[h2]isChildren

Method

public boolean isChildren()

您调用此API判断是否查询子节点。

Returns

Type

Description

boolean

  • true:返回子节点。
  • false:不返回子节点。

默认值为false。

[h2]getStrictBounds

Method

public Boolean getStrictBounds()

您调用此API可以获取到是否严格限制在Bounds内搜索。

Returns

Type

Description

Boolean

是否严格限制在Bounds内搜索。

[h2]getCountries

Method

public List<String> getCountries()

您调用此API可以获取当前设置的多个国家码。

Returns

Type

Description

List<String>

国家码列表。

[h2]setChildren

Method

public void setChildren(boolean children)

您调用此API可以设置是否返回子节点。

Parameters

Name

Description

children

是否返回子节点。

  • true:返回子节点siteId。
  • false:不返回子节点。

默认值为false。

[h2]setBounds

Method

public void setBounds(CoordinateBounds bounds)

您调用此API可以设置搜索结果偏向的范围。

Parameters

Name

Description

bounds

搜索结果偏向的范围。

说明:

如果同时设置了bounds和location,bounds优先。

[h2]setCountryCode

Method

public void setCountryCode(String countryCode)

您调用此API可以设置国家/地区码。

Parameters

Name

Description

countryCode

国家/地区码,在指定的国家内搜索,采用ISO 3166-1 alpha-2。

[h2]setLanguage

Method

public void setLanguage(String language)

您调用此API可以设置搜索结果的语种。

Parameters

Name

Description

language

搜索结果返回的语种,取值范围参见支持的语言的语种代码。如果不传,返回地点的当地语言。

[h2]setLocation

Method

public void setLocation(Coordinate location)

您调用此API可以设置搜索结果偏向的经纬度。

Parameters

Name

Description

location

搜索结果偏向的经纬度。

说明:

如果location、bounds都传的话,那么bounds优先。

[h2]setPoiTypes

Method

public void setPoiTypes(List<LocationType> poiTypes)

您调用此API可以设置返回地点的POI类型。

Parameters

Name

Description

poiTypes

POI类型。取值范围是LocationType的子集,包括:

  • GEOCODE
  • ADDRESS
  • ESTABLISHMENT
  • REGIONS
  • CITIES

[h2]setPoliticalView

该接口已废弃。

Method

public void setPoliticalView(String politicalView)

您调用此API可以设置政治观点。

Parameters

Name

Description

politicalView

政治观点,采用ISO 3166-1-alpha-2规范的2位国家/地区码。

[h2]setQuery

Method

public void setQuery(String query)

您调用此API可以设置搜索关键字。

Parameters

Name

Description

query

搜索关键字,query为必选参数。

[h2]setRadius

Method

public void setRadius(Integer radius)

您调用此API可以设置搜索半径。

Parameters

Name

Description

radius

搜索半径,单位:米。取值范围:[1, 50000],默认50000米。

[h2]setStrictBounds

Method

public void setStrictBounds(Boolean strictBounds)

您调用此API可以设置是否严格限制在Bounds内搜索。

Parameters

Name

Description

strictBounds

是否严格限制在Bounds内搜索,默认值为false。

[h2]setCountries

Method

public void setCountries(List<String> countries)

您调用此API可以设置多个国家码。

Parameters

Name

Description

countries

国家码列表。