net.rim.device.api.lbs.maps.server
Class ReverseGeocoder

java.lang.Object
  extended by net.rim.device.api.lbs.maps.server.ReverseGeocoder

public final class ReverseGeocoder
extends Object

Provides reverse geocoding capabilities, so you can request the address for a set of geographical coordinates. You can perform a reverse geocoding request asynchronously or synchronously.

To make an asynchronous call, you must provide a ServerExchangeCallback.

Asynchronous example:
ReverseGeocoder.getInstance().reverseGeocode(myServerExchangeCallback, new MapPoint(), ReverseGeocodeExchange.ADDRESS, -1, 0);

To make a synchronous (or blocking) call, you must pass null in as the ServerExchangeCallback. This forces the method to return the results of the query when it's complete.

Synchronous example:
ReverseGeocoder.getInstance().reverseGeocode(null, new MapPoint(), ReverseGeocodeExchange.ADDRESS, -1, 0);

Since:
BlackBerry API 7.0.0

Method Summary
static ReverseGeocoder getInstance()
          Retrieves the singleton ReverseGeocoder instance.
 ReverseGeocodeExchange reverseGeocode(ServerExchangeCallback callback, MapPoint point, int adminBoundary, int bearing, long timeout)
          Performs a reverse geocoding request to retrieve the address for a given set of coordinates.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

getInstance

public static final ReverseGeocoder getInstance()
Retrieves the singleton ReverseGeocoder instance.

Returns:
Returns the singleton instance of the ReverseGeocoder.
Since:
BlackBerry API 7.0.0

reverseGeocode

public final ReverseGeocodeExchange reverseGeocode(ServerExchangeCallback callback,
                                                   MapPoint point,
                                                   int adminBoundary,
                                                   int bearing,
                                                   long timeout)
                                            throws ReverseGeocodeException
Performs a reverse geocoding request to retrieve the address for a given set of coordinates.

Parameters:
callback - If provided, this will be an asynchronous call. If null the call will be blocking (synchronous).
point - The location point to reverse geocode. If the point is null an exception will be thrown.
adminBoundary - This should be a valid administration from the ReverseGeocodeExchange class.
bearing - The bearing the user is facing. Valid values range from 0 - 359. If the value is not valid, it is ignored.
timeout - The amount of time to wait for a connection to be established. For a synchronous call, it is also the amount of time to wait before the method is unblocked.
Returns:
The ReverseGeocodeExchange that is created for this call, which contains the reverse geocoding results and any errors.
Throws:
ReverseGeocodeException - if the point is null.
Since:
BlackBerry API 7.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal