HERE Android SDK Developer's Guide

GeocodeRequest

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

Class Summary

public class GeocodeRequest

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

GeocodeRequest 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 GeocodeRequest
Constructors

GeocodeRequest (String query)

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

Method Summary

Table 2. Methods in GeocodeRequest
Methods

public ErrorCode execute (ResultListener<Location> listener)

Executes an asynchronous request.

public int getCollectionSize ()

Gets the current collection size being used for request responses.

public GeocodeRequest setCollectionSize (int value)

Sets a collection size to be used for request responses.

public GeocodeRequest setMapViewport (GeoBoundingBox mapViewport)

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

public GeocodeRequest setSearchArea (GeoCoordinate center, int radius)

Sets the search area using a center location and radius.

public GeocodeRequest setSearchArea (GeoBoundingBox boundingArea)

Sets the search area using a GeoBoundingBox .

Class Details

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

Note: The response to a GeocodeRequest is a list of Location objects.

Constructor Details

GeocodeRequest (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<Location> 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 GeocodeRequest 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 GeocodeRequest object

public GeocodeRequest 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.

public GeocodeRequest 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 GeocodeRequest.

public GeocodeRequest setSearchArea (GeoBoundingBox boundingArea)

Sets the search area using a GeoBoundingBox .

Parameters:

  • boundingArea

    The GeoBoundingBox representing the search area.

Returns:

The GeocodeRequest.