目录

NearbySearchRequest

Class Info

public class NearbySearchRequest

Represents a request object used to search for nearby places.

Public Constructor Summary

Constructor Name

NearbySearchRequest()

Default constructor.

Public Method Summary

Qualifier and Type

Method Name and Description

HwLocationType

getHwPoiType()

Obtains the Huawei POI type of a place.

String

getLanguage()

Obtains the language for displaying searched nearby places.

Coordinate

getLocation()

Obtains the current location of a user.

Integer

getPageIndex()

Obtains the number of the current page.

Integer

getPageSize()

Obtains the number of records on each page.

LocationType

getPoiType()

Obtains the POI type of a place.

String

getPoliticalView()

Obtains the political view.

CAUTION:

This method has been deprecated.

String

getQuery()

Obtains the search keyword.

Integer

getRadius()

Obtains the search radius.

Boolean

getStrictBounds()

Obtains whether to strictly restrict place search in the bounds specified by location and radius.

void

setHwPoiType(HwLocationType hwPoiType)

Sets the Huawei POI type of a place.

void

setLanguage(String language)

Sets the language for displaying the search results.

void

setLocation(Coordinate location)

Sets the current location of a user.

void

setPageIndex(Integer pageIndex)

Sets the number of the current page.

void

setPageSize(Integer pageSize)

Sets the number of records on each page.

void

setPoiType(LocationType poiType)

Sets the POI type of a place.

void

setPoliticalView(String politicalView)

Sets the political view.

CAUTION:

This method has been deprecated.

void

setQuery(String query)

Sets the search keyword.

void

setRadius(Integer radius)

Sets the search radius.

void

setStrictBounds(Boolean strictBounds)

Sets whether to strictly restrict place search in the bounds specified by location and radius.

Public Methods

[h2]getHwPoiType

Method

public HwLocationType getHwPoiType()

Obtains the Huawei POI type of a place.

Returns

Type

Description

HwLocationType

Huawei POI type.

[h2]getLanguage

Method

public String getLanguage()

Obtains the language for displaying searched nearby places.

Returns

Type

Description

String

Language for displaying searched nearby places.

[h2]getLocation

Method

public Coordinate getLocation()

Obtains the current location of a user.

Returns

Type

Description

Coordinate

Current location of a user.

[h2]getPageIndex

Method

public Integer getPageIndex()

Obtains the number of the current page.

Returns

Type

Description

Integer

Number of the current page.

[h2]getPageSize

Method

public Integer getPageSize()

Obtains the number of records on each page.

Returns

Type

Description

Integer

Number of records on each page.

[h2]getPoiType

Method

public LocationType getPoiType()

Obtains the POI type of a place.

Returns

Type

Description

LocationType

POI type of a place.

[h2]getPoliticalView

This method has been deprecated.

Method

public String getPoliticalView()

Obtains the political view.

Returns

Type

Description

String

Political view.

[h2]getQuery

Method

public String getQuery()

Obtains the search keyword.

Returns

Type

Description

String

Search keyword.

[h2]getRadius

Method

public Integer getRadius()

Obtains the search radius.

Returns

Type

Description

Integer

Search radius, in meters.

[h2]getStrictBounds

Method

public Boolean getStrictBounds()

Obtains whether to strictly restrict place search in the bounds specified by location and radius.

Returns

Type

Description

Boolean

Whether to strictly restrict place search in the bounds specified by location and radius.

[h2]setHwPoiType

Method

public void setHwPoiType(HwLocationType hwPoiType)

Sets the Huawei POI type.

Parameters

Name

Description

hwPoiType

Huawei POI type. This parameter is recommended.

NOTE:

If both hwPoiType and poiType are set, search results of hwPoiType take precedence.

[h2]setLanguage

Method

public void setLanguage(String language)

Sets the language for displaying the search results.

Parameters

Name

Description

language

Language for displaying the search results. For details, please refer to Supported Languages. If this parameter is not passed, the local language will be used.

[h2]setLocation

Method

public void setLocation(Coordinate location)

Sets the current location of a user.

Parameters

Name

Description

location

Current location of a user. This parameter is mandatory.

[h2]setPageIndex

Method

public void setPageIndex(Integer pageIndex)

Sets the current page number.

Parameters

Name

Description

pageIndex

Number of the current page. The value ranges from 1 to 60. The default value is 1.

NOTE:

pageIndex * pageSize<=60

[h2]setPageSize

Method

public void setPageSize(Integer pageSize)

Sets the number of records on each page.

Parameters

Name

Description

pageSize

Number of records on each page. The value ranges from 1 to 20. The default value is 20.

NOTE:

pageIndex * pageSize<=60

[h2]setPoiType

Method

public void setPoiType(LocationType poiType)

Sets the Huawei POI type of a place.

Parameters

Name

Description

poiType

POI type.

NOTE:

Huawei POI types are recommended.

[h2]setPoliticalView

This method has been deprecated.

Method

public void setPoliticalView(String politicalView)

Sets the political view.

Parameters

Name

Description

politicalView

Political view. The value is a two-letter country/region code complying with ISO 3166-1 alpha-2.

[h2]setQuery

Method

public void setQuery(String query)

Sets the search keyword.

Parameters

Name

Description

query

Search keyword.

[h2]setRadius

Method

public void setRadius(Integer radius)

Sets the search radius.

Parameters

Name

Description

radius

Search radius, in meters. The value ranges from 1 to 50,000. The default value is 1000.

[h2]setStrictBounds

Method

public void setStrictBounds(Boolean strictBounds)

Sets whether to strictly restrict place search in the bounds specified by location and radius.

Parameters

Name

Description

strictBounds

Indicates whether to strictly restrict place search in the bounds specified by location and radius. The default value is true.