Open BlackBerry Maps by using a landmark
You can open BlackBerry® Maps to display the location of a landmark on a map by specifying an array of Landmark objects. A landmark object can contain a display label name, a description, the geospatial coordinates, and a street address.
If you do not specify the coordinates, BlackBerry Maps can use the address to find the coordinates. If the coordinates and address are invalid, BlackBerry Maps does not display the location of the landmark.
Code sample: Opening BlackBerry Maps by using a landmark
import net.rim.blackberry.api.invoke.*;
import javax.microedition.location.*;
public class invokeMaps
{
public invokeMaps ()
{
Landmark[] landMarks = new Landmark[3];
AddressInfo addressInfo = new AddressInfo();
addressInfo.setField(AddressInfo.STREET, "455 Phillip St");
addressInfo.setField(AddressInfo.CITY, "Waterloo");
addressInfo.setField(AddressInfo.STATE, "Ontario");
landMarks[0] = new Landmark("AAA", "Description 1", null, addressInfo);
QualifiedCoordinates coordinates =
new QualifiedCoordinates(45.4, -75.1, 0, 0, 0);
landMarks[1] = new Landmark("BBB", "Description 2", coordinates, null);
coordinates = new QualifiedCoordinates(45.3,-75.3,0,0,0);
landMarks[2] = new Landmark("CCC", "Description 3", coordinates, null);
MapsArguments ma = new MapsArguments(landMarks);
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, ma);
}
}
Parent topic: BlackBerry Maps