public class HereRequest extends DiscoveryRequest
HereRequest
answers the questions "Where am I?" and
"What's right here where I am standing?" The search results consist of a list of places with
addresses that lie within the vicinity of the search location. The feature is typically used by
applications that include "check-in" or "click on map to get more information" options.
A search location context must be provided by setting either a search center using
setSearchCenter(GeoCoordinate)
or a bounding map viewport using
DiscoveryRequest.setMapViewport(GeoBoundingBox)
. Failing to set a map viewport will
result in an ErrorCode.INVALID_PARAMETER
when executing the request.
BUILDING_ID_REFERENCE_NAME, PLACE_CONTENT_WIKIPEDIA, PVID_ID_REFERENCE_NAME, VENUES_CONTENT_ID_REFERENCE_NAME, VENUES_DESTINATION_ID_REFERENCE_NAME, VENUES_ID_REFERENCE_NAME, VENUES_VENUE_ID_REFERENCE_NAME
Constructor and Description |
---|
HereRequest()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
HereRequest |
addBuildingFilter(java.lang.String buildingId)
Sets a search filter based on building identifier.
|
ErrorCode |
execute(ResultListener<DiscoveryResultPage> listener)
Executes an asynchronous request.
|
HereRequest |
setCategoryFilter(CategoryFilter filter)
Sets a search filter based on categories.
|
HereRequest |
setSearchCenter(GeoCoordinate center)
Sets the search center.
|
addImageDimensions, addReference, getCollectionSize, getReferences, getRichTextFormatting, setCollectionSize, setMapViewport, setRichTextFormatting, setSearchArea, setSearchArea
public HereRequest()
A search location context must be provided by setting either a search center using
setSearchCenter(GeoCoordinate)
or a bounding map viewport using
DiscoveryRequest.setMapViewport(GeoBoundingBox)
. Failing to set a map viewport will
result in an ErrorCode.INVALID_PARAMETER
when executing the request.
public HereRequest setSearchCenter(GeoCoordinate center)
setSearchCenter
in class DiscoveryRequest
center
- The GeoCoordinate
representing the location context used to search for
nearby places.HereRequest
.public HereRequest setCategoryFilter(CategoryFilter filter)
setCategoryFilter
in class DiscoveryRequest
filter
- A CategoryFilter
representing the category filter. When a
CategoryFilter
is specified, the result items will be limited to the
categories defined in the filter.HereRequest
.public HereRequest addBuildingFilter(java.lang.String buildingId)
The building identifier can also be retrieved using
DiscoveryRequest.addReference(String)
and PlaceLink.getReference(String)
(or
PlaceRequest.addReference(String)
and Place.getReference(String)
).
addBuildingFilter
in class DiscoveryRequest
buildingId
- A building identifier. When a filter is specified, the result items will be
limited to the buildings with identifiers defined in the filter.HereRequest
.Request.BUILDING_ID_REFERENCE_NAME
,
DiscoveryRequest.addReference(String)
,
PlaceLink.getReference(String)
,
PlaceRequest.addReference(String)
,
Place.getReference(String)
public ErrorCode execute(ResultListener<DiscoveryResultPage> listener)
execute
in class DiscoveryRequest
listener
- A ResultListener
passed along with the request to monitor progressErrorCode
representing an appropriate result