Blackberry GPS and BlackBerry Maps Руководство - Страница 23

Просмотреть онлайн или скачать pdf Руководство для Программное обеспечение Blackberry GPS and BlackBerry Maps. Blackberry GPS and BlackBerry Maps 35 страниц. Version: 4.7.0

Development Guide
enter the
application into the main event thread.
}
}
}
12. Create a screen for the application.
final class MapsMenuItemScreen extends MainScreen
{
private MapView _mapview;
private BasicEditField _latitudeField;
private BasicEditField _logitudeField;
private NumericChoiceField _zoomField;
//Constructor
/**
* @param _mv The MapView context object.
*/
MapsMenuItemScreen(MapView _mv)
{
_mapview = _mv;
// The int values that getLatitude() and getLongitude() return are
100,000 times
// the values specified by WGS84.
_latitudeField = new BasicEditField ("Latitude:
_mv.getLatitude()/100000.0 + "" , 9 ,
BasicEditField.FILTER_REAL_NUMERIC );
_logitudeField = new BasicEditField ("Longitude:
_mv.getLongitude()/100000.0 + "" , 10 ,
BasicEditField.FILTER_REAL_NUMERIC);
_zoomField = new NumericChoiceField ("Zoom: " , 0 ,
MapView.MAX_ZOOM , 1 , _mv.getZoom());
// Add GUI components.
add(_latitudeField);
add(_logitudeField);
add(_zoomField);
add(new SeparatorField());
add(new RichTextField("Edit latitude, longitude and zoom level
settings and select View Map from the menu." ,
Field.NON_FOCUSABLE));
addMenuItem(viewMapItem);
setTitle("Location Details Screen");
}
// The ApplicationMenuItem invoked App . Call the default
// constructor for the GUI version of the application and
MapsMenuItemDemo app = new MapsMenuItemDemo();
app.enterEventDispatcher();
Displaying location information on a BlackBerry device
" ,
" ,
21