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.

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 with KML format
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
          Argument to open Maps and display points using the provided 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 local search API.
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 with provided arguments
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
Argument to open Maps and display points using the provided 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 with KML format

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 arguments instruct Maps to open in the default view or last lat/long.

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, the Maps application starts in the default state. Note: the rotation specified in the view is currently 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 with provided arguments

Parameters:
contact - A contact with at least one address. The Maps application will start and attempt to search for one of the addresses for the contact. If the contact has no addresses, when invoked with this MapsArgument the Maps application will open to the default location.
addressIndex - The index (beginning at 0) of the address you would like displayed. If the index is invalid, when invoked with this MapsArgument the Maps application will open 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:
Landmark[] - A 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 will take AddressInfo and do a geocode call to get coordinates. If the Landmark does not have coordinates or address info, the MapsArgument will throw a 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. See the BlackBerry Java Development Environment Development Guide for more information about BlackBerry Maps and the location document.

In the application code, you must multiply the latitudinal and longitudinal values used by the javax.microedition.locationCoordinates class by 100,000.

In the following example, the internal GPS 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 code sends 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.

Parameters:
type - Can be either #ARG_LOCATION_DOCUMENT) for locations or routes, or (@link #ARG_KML.
data - XML location document that contains location/route data, or URL string for kml
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 local search API. See the BlackBerry Java Development Environment Development Guide for more information about BlackBerry Maps and the location document.

Parameters:
type - Specify MapsArguments.ARG_LOCAL_SEARCH to open BlackBerry Maps to display local search results. Currently MapsArguments.ARG_LOCAL_SEARCH is the only value that can be passed in.
what - The type of business to be searched for.
where - General location of the business you are interested. It can be either an address/city name or a coordinate (WPS84, latitude, longitude). If you use a coordinate you must multiply the latitudinal and longitudinal values by 100,000.
Throws:
IllegalArgumentException - if the arguments are invalid.

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

Example 2:
MapsArguments mapsArgs = new MapsArguments(MapsArguments.ARG_LOCAL_SEARCH, "gas", "4542349,-7569792");
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, mapsArgs);

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-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.