menu.setDefault(1);
}
}
View a sample application that starts a BlackBerry Application from BlackBerry Maps
1.
From the BlackBerry® Integrated Development Environment, launch the BlackBerry Smartphone Simulator.
2.
In the BlackBerry Smartphone Simulator, launchBlackBerry Maps.
3.
In BlackBerry Maps, click
Menu Item Demo
.
4.
Complete the instructions on the screen and click
View Map
.
Displaying location information in your application
A BlackBerry® device application can use the
MapField
class to display a map in a UI field. For a BlackBerry device application
to use the
MapField
class, BlackBerry® Maps must be installed on the BlackBerry device and the BlackBerry device must be
able to download data from the map server for location-based services.
A
MapField
gets data either from a map server for location-based services or the BlackBerry device with BlackBerry Maps
installed. If location information is not present on the BlackBerry device, the
MapField
requests data from the map server.
See the API reference for the BlackBerry Java Development Environment for more information about the
MapField
API.
Work with a map that displays in a UI field
1.
Import the
net.rim.device.api.lbs.MapField
class.
2.
Invoke any of the following methods:
Task
Steps
Modify the center of a
MapField
using latitudinal
and longitudinal values, in
degrees.
Invoke
moveTo(int latitude, int longitude)
. The latitude
and longitude values are calculated as degrees multiplied by 100,000.
Modify the center of a
MapField
to specific
coordinates.
Invoke
moveTo(javax.microedition.
location.Coordinates coords)
.
Development Guide
Displaying location information in your application
23