HERE Android SDK Developer's Guide

GeocodeRequest2

The class GeocodeRequest2 is a member of com.here.android.mpa.search .

Class Summary

public class GeocodeRequest2

extends com.here.android.mpa.search.Request, java.lang.Object

GeocodeRequest2 represents an extended Request used to retrieve Location data by way of Geocoder search services.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in GeocodeRequest2
Constructors

GeocodeRequest2 (String query)

Creates a geocoder request that resolves a free text query into a Location.

Method Summary

Table 2. Methods in GeocodeRequest2
Methods

public ErrorCode execute (ResultListener<GeocodeResult> listener)

Executes an asynchronous request.

public int getCollectionSize ()

Gets the current collection size being used for request responses.

public GeocodeRequest2 setCollectionSize (int value)

Sets a collection size to be used for request responses.

public GeocodeRequest2 setMapViewport (GeoBoundingBox mapViewport)

The map viewport is a bounding box of the map area currently visible to the user.

public GeocodeRequest2 setSearchArea (GeoCoordinate center, int radius)

Sets the search area using a center location and radius.

public GeocodeRequest2 setSearchArea (GeoBoundingBox boundingArea)

Sets the search area using a GeoBoundingBox .

Class Details

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.

Constructor Details

GeocodeRequest2 (String query)

Creates a geocoder request that resolves a free text query into a Location.

Parameters:

  • query

    Query text specifying the address to locate.

Throws:

  • IllegalArgumentException

    Upon a failure to handle a passed argument.

Method Details

public ErrorCode execute (ResultListener<GeocodeResult> listener)

Executes an asynchronous request.

Parameters:

  • listener

    A ResultListener passed along with the request to monitor progress.

Returns:

The ErrorCode representing an appropriate result.

public int getCollectionSize ()

Gets the current collection size being used for request responses.

Returns:

The current response collection size.

public GeocodeRequest2 setCollectionSize (int value)

Sets a collection size to be used for request responses. The maximum number of result items in each collection will be limited to this value. The valid value range is [1..100]. The default collection size is 20.

Parameters:

  • value

    Desired response collection size per request.

Returns:

This GeocodeRequest2 object.

public GeocodeRequest2 setMapViewport (GeoBoundingBox mapViewport)

The map viewport is a bounding box of the map area currently visible to the user. The viewport can act as an implicit location context in the absence of an explicit location context. To ensure you get the best results possible, you should always set a viewport if there is a map visible to the user.

Parameters:

  • mapViewport

    The bounding box of the map area currently visible.

Returns:

This GeocodeRequest2 object.

public GeocodeRequest2 setSearchArea (GeoCoordinate center, int radius)

Sets the search area using a center location and radius.

Parameters:

  • center

    The GeoCoordinate representing the search area center location.

  • radius

    The search area circle radius in meters.

Returns:

The GeocodeRequest2.

public GeocodeRequest2 setSearchArea (GeoBoundingBox boundingArea)

Sets the search area using a GeoBoundingBox .

Parameters:

  • boundingArea

    The GeoBoundingBox representing the search area.

Returns:

The GeocodeRequest2.