Invoke BlackBerry Maps by using a KML document

You can invoke BlackBerry® Maps by passing in a MapsArguments object that specifies the URL of a KML document.
Before you begin: Verify that you have created a KML document and published the document to a web site.
  1. Import the required classes.
    import net.rim.blackberry.api.invoke.*;
  2. Create a class and a constructor to use to invoke BlackBerry Maps.
    public class invokeMaps
    {
        public invokeMaps()
        {
        }
    }
  3. In the constructor, create an instance of the MapsArguments class. Pass in the ARG_KML parameter and the URL of the KML document.
    MapsArguments ma = new MapsArguments
        (MapsArguments.ARG_KML, "http://www.example.com/document.kml");
  4. In the constructor, invoke Invoke.invokeApplication() to open BlackBerry Maps. Pass in the MapsArguments object.
    Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, ma);

Code sample: Invoking BlackBerry Maps by using a KML document

import net.rim.blackberry.api.invoke.*;

public class invokeMaps
{
    public invokeMaps()
    {
        MapsArguments ma = new MapsArguments
          (MapsArguments.ARG_KML, "http://www.example.com/document.kml");
        Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, ma);
    }
}

Was this information helpful? Send us your comments.