public class ExploreRequest extends DiscoveryRequest
ExploreRequest
using a specified location context and category filter. An
explore request is used for retrieving a list of nearby relevant places for a given position. It
answers the question "What interesting places are near a location?" The results returned are
confined to those located in the current search area and are ordered by popularity. If a category
filter is provided, the created request will limit results to include only items with the
specified categories.
A search location context must be provided by setting either a search center using
setSearchCenter(GeoCoordinate)
, a search area using
setSearchArea(GeoCoordinate, int)
or
setSearchArea(GeoBoundingBox)
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 |
---|
ExploreRequest()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
ErrorCode |
execute(ResultListener<DiscoveryResultPage> listener)
Executes an asynchronous request.
|
ExploreRequest |
setCategoryFilter(CategoryFilter filter)
Sets a search filter based on categories.
|
ExploreRequest |
setSearchArea(GeoBoundingBox boundingArea)
Sets the search area using a
GeoBoundingBox . |
ExploreRequest |
setSearchArea(GeoCoordinate center,
int radius)
Sets the search area using a center location and radius.
|
ExploreRequest |
setSearchCenter(GeoCoordinate center)
Sets the search center.
|
addBuildingFilter, addImageDimensions, addReference, getCollectionSize, getReferences, getRichTextFormatting, setCollectionSize, setMapViewport, setRichTextFormatting
public ExploreRequest()
A search location context must be provided by setting either a search center using
setSearchCenter(GeoCoordinate)
, a search area using
setSearchArea(GeoCoordinate, int)
or
setSearchArea(GeoBoundingBox)
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 ExploreRequest setSearchCenter(GeoCoordinate center)
setSearchCenter
in class DiscoveryRequest
center
- The GeoCoordinate
representing the location context used to search for
nearby places.ExploreRequest
.public ExploreRequest setSearchArea(GeoCoordinate center, int radius)
setSearchArea
in class DiscoveryRequest
center
- TheGeoCoordinate
representing the search area center location.radius
- The search area circle radius in meters.ExploreRequest
.public ExploreRequest setSearchArea(GeoBoundingBox boundingArea)
GeoBoundingBox
.setSearchArea
in class DiscoveryRequest
boundingArea
- TheGeoBoundingBox
representing the search area.ExploreRequest
.public ExploreRequest 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.ExploreRequest
.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