Help Center

Local Navigation

Clear data from a map

You can create a BlackBerry® device application that clears data from the map that the BlackBerry® Maps displays. A location document String with id and clear attributes uses the following format:
<lbs id='<string>' clear='{NONE | DOCS | LOCATIONS | ROUTES | ALL | comma_delimited_list_of_document_ids}'>
  1. Import the following classes:
    • java.lang.String
    • net.rim.blackberry.api.invoke.Invoke
  2. Perform one of the following tasks:

    Task

    Step

    Clear data from a location document that has an id attribute.

    1. Create a String that configures the clear attribute to the id of the location document that contains the data that you want to remove from a map.
      String document = "<lbs clear='Montreal' ><location x='-8052237' y='4346518' label='Waterloo, ON' description='Waterloo' zoom='10'/></lbs>";

    Clear data from all location documents that have an id attribute.

    1. Create a String that configures the clear attribute to Docs.
      String document = "<lbs clear='Docs' ><location x='-8052237' y='4346518' label='Waterloo, ON' description='Waterloo' zoom='10'/></lbs>";

    Clear data from specific location documents that have an id attribute.

    1. Create a String that configures the clear attribute to a comma-delimited list of id values.
      String document = "<lbs clear='MONTREAL,OTTAWA' ><location x='-8052237' y='4346518' label='Waterloo, ON' description='Waterloo' zoom='10'/></lbs>";

    Clear all location data from a map.

    1. Create a String that configures the clear attribute to Locations.
      String document = "<lbs clear='Locations' ><location x='-8052237' y='4346518' label='Waterloo, ON' description='Waterloo' zoom='10'/></lbs>";
  3. Invoke Invoke.invokeApplication() using the String variable as a parameter.
    Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments
    ( MapsArguments.ARG_LOCATION_DOCUMENT, document));
    
Next topic: Resources

Was this information helpful? Send us your comments.