|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.blackberry.api.invoke.ApplicationArguments
net.rim.blackberry.api.invoke.MapsArguments
public final class MapsArguments
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.
Field Summary | ||
---|---|---|
|
static String |
ARG_KML
Use this argument to open Maps and display information provided from a KML document. |
|
static String |
ARG_LOCAL_SEARCH
Use this argument to open Maps and display local search information. |
|
static String |
ARG_LOCATION_DOCUMENT
Use this argument to open Maps and display points provided by a location document. |
Constructor Summary | ||
---|---|---|
|
MapsArguments()
Creates a new MapsArguments instance with default arguments. |
|
|
MapsArguments(String type,
String data)
Creates a new MapsArguments instance with String arguments. |
|
|
MapsArguments(String type,
String what,
String where)
Creates a new MapsArguments instance for invoking a local search. |
|
|
MapsArguments(Landmark[] landmarks)
Creates a new MapsArguments instance with a list of landmarks. |
|
|
MapsArguments(Contact contact,
int addressIndex)
Creates a new MapsArguments instance using the provided
contact and adddress index. |
|
|
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 |
---|
public static final String ARG_LOCATION_DOCUMENT
public static final String ARG_KML
public static final String ARG_LOCAL_SEARCH
Constructor Detail |
---|
public MapsArguments()
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.
public MapsArguments(MapView mapView)
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.
mapView
- The view used to display the map.public MapsArguments(Contact contact, int addressIndex)
MapsArguments
instance using the provided
contact and adddress index.
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.public MapsArguments(Landmark[] landmarks)
MapsArguments
instance with a list of landmarks.
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.
IllegalArgumentException
- if the arguments are invalid.public MapsArguments(String type, String data)
MapsArguments
instance with String arguments.
type
- The type, which can be one of the following:
MapsArguments.ARG_LOCATION_DOCUMENT
for locations or routes in a location document
MapsArguments.ARG_KML
for KML documents
data
- The XML location document that contains the location or route data,
or a URL string for the KML document.
IllegalArgumentException
- if the arguments are invalid.public MapsArguments(String type, String what, String where)
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);
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.
IllegalArgumentException
- if the arguments are invalid.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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