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.

Map field

Use a map field to display a map in a BlackBerry device application.

Class

MapField

Supported since

BlackBerry Java SDK 6.0

More information

For more information about map fields and location-based services, see the Location-Based Services Development Guide.

Example

This screen shows a map.

import net.rim.device.api.lbs.maps.model.*;
import net.rim.device.api.lbs.maps.ui.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;

public class MapFieldDemo extends UiApplication
{
    public static void main(String[] args)
    {
        MapFieldDemo theApp = new MapFieldDemo();
        theApp.enterEventDispatcher();
    }
    public MapFieldDemo()
    {
        pushScreen(new MapScreen());
    }
}

class MapScreen extends FullScreen
{
    public MapScreen() 
    {
        super( FullScreen.DEFAULT_CLOSE | FullScreen.DEFAULT_MENU );
        MapField map = new MapField();
        MapAction action = map.getAction();
        action.setCentreAndZoom(new MapPoint(43.46518, -80.52237), 3);   
        add(map);
    }
}