public class GeocodeRequest2 extends Request<java.util.List<GeocodeResult>>
GeocodeRequest2
represents an extended Request
used to retrieve Location
data by way of Geocoder
search services.
Note: The response to a GeocodeRequest2
is a list of Location
objects.
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 |
---|
GeocodeRequest2(java.lang.String query)
Creates a geocoder request that resolves a free text query into a
Location . |
Modifier and Type | Method and Description |
---|---|
ErrorCode |
execute(ResultListener<java.util.List<GeocodeResult>> listener)
Executes an asynchronous request.
|
int |
getCollectionSize()
Gets the current collection size being used for request responses.
|
GeocodeRequest2 |
setCollectionSize(int value)
Sets a collection size to be used for request responses.
|
GeocodeRequest2 |
setMapViewport(GeoBoundingBox mapViewport)
The map viewport is a bounding box of the map area currently visible to the user.
|
GeocodeRequest2 |
setSearchArea(GeoBoundingBox boundingArea)
Sets the search area using a
GeoBoundingBox . |
GeocodeRequest2 |
setSearchArea(GeoCoordinate center,
int radius)
Sets the search area using a center location and radius.
|
public GeocodeRequest2(java.lang.String query) throws java.lang.IllegalArgumentException
Location
.query
- Query text specifying the address to locate.java.lang.IllegalArgumentException
- Upon a failure to handle a passed argument.public GeocodeRequest2 setSearchArea(GeoCoordinate center, int radius)
center
- TheGeoCoordinate
representing the search area center location.radius
- The search area circle radius in meters.GeocodeRequest2
.public GeocodeRequest2 setSearchArea(GeoBoundingBox boundingArea)
GeoBoundingBox
.boundingArea
- TheGeoBoundingBox
representing the search area.GeocodeRequest2
.public int getCollectionSize()
public GeocodeRequest2 setCollectionSize(int value)
value
- Desired response collection size per request.GeocodeRequest2
object.public GeocodeRequest2 setMapViewport(GeoBoundingBox mapViewport)
mapViewport
- The bounding box of the map area currently visible.GeocodeRequest2
object.public ErrorCode execute(ResultListener<java.util.List<GeocodeResult>> listener)
listener
- A ResultListener
passed along with the request to monitor progress.ErrorCode
representing an appropriate result.