net.rim.blackberry.api.invoke
Class MapsArguments

java.lang.Object
  extended by net.rim.blackberry.api.invoke.ApplicationArguments
      extended by net.rim.blackberry.api.invoke.MapsArguments

public final class MapsArguments
extends ApplicationArguments

Encapsulates arguments to pass to the BlackBerry Maps application.

The MapsArguments that are provided can open BlackBerry Maps to display locations using a KML document, location document, landmarks, location search information, or a BlackBerry Maps URL.

For latitudinal and longitudinal values that are used by the Coordinates class, you must multiply the values by 100,000. For example, the internal GPS receiver of a BlackBerry device returns values of 43.67022 and -79.38675 for the latitude and longitude of a location. After multiplying each value by 100,000, your application sends values of 4,367,022 and -7,938,675 to the location document. BlackBerry Maps interprets and displays these values as 43.67022 degrees latitude and -79.38675 degrees longitude, respectively.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

Field Summary
Category: Signed static String ARG_KML
          Use this argument to open Maps and display information provided from a KML document.
Category: Signed static String ARG_LOCAL_SEARCH
          Use this argument to open Maps and display local search information.
Category: Signed static String ARG_LOCATION_DOCUMENT
          Use this argument to open Maps and display points provided by a location document.
 
Constructor Summary
Category: Signed MapsArguments()
          Creates a new MapsArguments instance with default arguments.
Category: Signed MapsArguments(String type, String data)
          Creates a new MapsArguments instance with String arguments.
Category: Signed MapsArguments(String type, String what, String where)
          Creates a new MapsArguments instance for invoking a local search.
Category: Signed MapsArguments(Landmark[] landmarks)
          Creates a new MapsArguments instance with a list of landmarks.
Category: Signed MapsArguments(Contact contact, int addressIndex)
          Creates a new MapsArguments instance using the provided contact and adddress index.
Category: Signed MapsArguments(MapView mapView)
          Creates a new MapsArguments instance with a specified view.
 
Method Summary
 
Methods inherited from class net.rim.blackberry.api.invoke.ApplicationArguments
getArgs
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

ARG_LOCATION_DOCUMENT

public static final String ARG_LOCATION_DOCUMENT
Use this argument to open Maps and display points provided by a location document.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

ARG_KML

public static final String ARG_KML
Use this argument to open Maps and display information provided from a KML document.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 5.0.0

ARG_LOCAL_SEARCH

public static final String ARG_LOCAL_SEARCH
Use this argument to open Maps and display local search information.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 5.0.0


Constructor Detail

MapsArguments

public MapsArguments()
Creates a new MapsArguments instance with default arguments.

The default constructor instructs the Maps application to open to the default location as specified by the user in the Maps application options.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

MapsArguments

public MapsArguments(MapView mapView)
Creates a new MapsArguments instance with a specified view. If the mapView parameter is null, BlackBerry Maps starts in the default state.

Note: The rotation specified in the view is ignored.

Parameters:
mapView - The view used to display the map.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.1

MapsArguments

public MapsArguments(Contact contact,
                     int addressIndex)
Creates a new MapsArguments instance using the provided contact and adddress index.

Parameters:
contact - A contact with at least one address. The Maps application starts and searches for one of the addresses for the contact. If the contact has no addresses, the Maps application opens to the default location.
addressIndex - The index (beginning at 0) of the address to display. If the index is invalid, the Maps application opens to the default location.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.1

MapsArguments

public MapsArguments(Landmark[] landmarks)
Creates a new MapsArguments instance with a list of landmarks.

Parameters:
landmarks - An array of Landmark objects. A Landmark contains a name (for displayed label) and/or QualifiedCoordinates, and/or AddressInfo. If the coordinate attribute does not have a value, the Maps application takes AddressInfo and performs a geocode call to retrieve the coordinates. If the Landmark does not have coordinates or address info, the MapsArgument throws an IllegalArgumentException.
Throws:
IllegalArgumentException - if the arguments are invalid.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 5.0.0

MapsArguments

public MapsArguments(String type,
                     String data)
Creates a new MapsArguments instance with String arguments.

Parameters:
type - The type, which can be one of the following:
data - The XML location document that contains the location or route data, or a URL string for the KML document.
Throws:
IllegalArgumentException - if the arguments are invalid.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

MapsArguments

public MapsArguments(String type,
                     String what,
                     String where)
Creates a new MapsArguments instance for invoking a local search.

Example 1: Invoking BlackBerry Map with local search parameters with a city name
MapsArguments mapsArgs = new MapsArguments(MapsArguments.ARG_LOCAL_SEARCH, "hotel", "Ottawa");
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, mapsArgs);

Example 2: Invoking BlackBerry Map with local search parameters with coordinates
MapsArguments mapsArgs = new MapsArguments(MapsArguments.ARG_LOCAL_SEARCH, "gas", "4542349,-7569792");
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, mapsArgs);

Parameters:
type - Use MapsArguments.ARG_LOCAL_SEARCH to open BlackBerry Maps to display local search results.
what - The type of business to be searched for.
where - The general location of the business you are interested in. It can be either an address/city name or a coordinate (WPS84, latitude, longitude). If you use a Coordinates object, you must multiply the latitudinal and longitudinal values by 100,000.
Throws:
IllegalArgumentException - if the arguments are invalid.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 5.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