目录

NearbySearchRequest

Class Info

public class NearbySearchRequest

周边地点搜索的请求对象。

Public Constructor Summary

Constructor Name

NearbySearchRequest()

默认的构造方法。

Public Method Summary

Qualifier and Type

Method Name and Description

HwLocationType

getHwPoiType()

获取返回地点的华为POI类型。

String

getLanguage()

获取用于查询周边地点详情的语种。

Coordinate

getLocation()

获取到用户当前位置。

Integer

getPageIndex()

获取到当前页数。

Integer

getPageSize()

获取到每页的记录数。

LocationType

getPoiType()

获取返回地点的POI类型。

String

getPoliticalView()

获取政治观点。

注意:

该接口已废弃。

String

getQuery()

获取到搜索关键字。

Integer

getRadius()

获取到搜索半径。

Boolean

getStrictBounds()

获取到是否严格限制在location+radius内搜索。

void

setHwPoiType(HwLocationType hwPoiType)

设置返回地点的华为POI类型。

void

setLanguage(String language)

设置搜索结果返回的语言。

void

setLocation(Coordinate location)

设置用户当前位置。

void

setPageIndex(Integer pageIndex)

设置当前页数。

void

setPageSize(Integer pageSize)

设置每页的记录数。

void

setPoiType(LocationType poiType)

设置返回地点的POI类型。

void

setPoliticalView(String politicalView)

设置政治观点。

注意:

该接口已废弃。

void

setQuery(String query)

设置搜索关键字。

void

setRadius(Integer radius)

设置搜索半径。

void

setStrictBounds(Boolean strictBounds)

设置是否严格限制在location+radius内搜索。

Public Methods

[h2]getHwPoiType

Method

public HwLocationType getHwPoiType()

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

Returns

Type

Description

HwLocationType

地点的华为POI类型。

[h2]getLanguage

Method

public String getLanguage()

您调用此API可以获取用于查询周边地点详情的语种。

Returns

Type

Description

String

用于查询周边地点详情的语种。

[h2]getLocation

Method

public Coordinate getLocation()

您调用此API可以获取到用户当前位置。

Returns

Type

Description

Coordinate

用户当前位置。

[h2]getPageIndex

Method

public Integer getPageIndex()

您调用此API可以获取到当前页数。

Returns

Type

Description

Integer

当前页数。

[h2]getPageSize

Method

public Integer getPageSize()

您调用此API可以获取到每页的记录数。

Returns

Type

Description

Integer

每页的记录数。

[h2]getPoiType

Method

public LocationType getPoiType()

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

Returns

Type

Description

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]getStrictBounds

Method

public Boolean getStrictBounds()

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

Returns

Type

Description

Boolean

是否严格限制在location+radius内搜索。

[h2]setHwPoiType

Method

public void setHwPoiType(HwLocationType hwPoiType)

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

Parameters

Name

Description

hwPoiType

华为POI类型,推荐使用该类型。

说明:

如果同时设置了hwPoiType和poiType,搜索结果优先符合hwPoiType。

[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为必选参数。

[h2]setPageIndex

Method

public void setPageIndex(Integer pageIndex)

您调用此API可以设置当前页数。

Parameters

Name

Description

pageIndex

当前页数。取值范围:[1, 60],默认1。

说明:

pageIndex * pageSize<=60

[h2]setPageSize

Method

public void setPageSize(Integer pageSize)

您调用此API可以设置每页的记录数。

Parameters

Name

Description

pageSize

每页的记录数。取值范围:[1, 20],默认20。

说明:

pageIndex * pageSize<=60

[h2]setPoiType

Method

public void setPoiType(LocationType poiType)

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

Parameters

Name

Description

poiType

POI类型。

说明:

推荐使用华为POI类型。

[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

搜索关键字。

[h2]setRadius

Method

public void setRadius(Integer radius)

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

Parameters

Name

Description

radius

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

[h2]setStrictBounds

Method

public void setStrictBounds(Boolean strictBounds)

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

Parameters

Name

Description

strictBounds

是否严格限制在location+radius内搜索,默认值为true。