Would you like to tell us how we are doing?

You bet No thanks

Sorry about the red box, but we really need you to update your browser. Read this excellent article if you're wondering why we are no longer supporting this browser version. Go to Browse Happy for browser suggestions and how to update.

Open BlackBerry Maps with 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 with a landmark

import net.rim.blackberry.api.invoke.*;
import javax.microedition.location.*;

//Create a class and constructor to use to invoke BlackBerry Maps. 
public class invokeMaps
    public invokeMaps ()

// In the constructor, create an array of Landmark objects that 
//you can use to add the landmark information to.  
        Landmark[] landMarks = new Landmark[3];

//In the constructor, create an AddressInfo array and invoke 
//AddressInfo.setField() to specify the street address. Add the 
//AddressInfo array to the Landmark array.  
        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);

//In the constructor, create an instance of the QualifiedCoordinates class 
//and specify the coordinates. Add the QualifiedCoordinates to the Landmark array. 
        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);

//In the constructor, create an instance of the MapsArguments class using the 
//Landmarks array as an argument. Invoke Invoke.invokeApplication() to open 
//BlackBerry Maps. Pass in the MapsArguments object.
        MapsArguments ma = new MapsArguments(landMarks);
        Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, ma);