Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Latest news

Last at Tue, 6 Dec 2011 18:37:53
Topic: New BlackBerry sample app
See more news »

Using MapComponent in Blackberry

4 replies [Last post]
matthewlcy
User offline. Last seen 2 years 1 week ago. Offline
Joined: 08/24/2009

Hi, I am now developing an application under BlackBerry. I want to customize the user interface of the program as follow:

-----------------------------
| status bar |
-----------------------------
| |
| |
| the map |
| |
| |
-----------------------------
| banner |
-----------------------------

Since I am building native BlackBerry applications, I can only use MapComponent of BasicMapComponent to display the map.

I have tried several methods but I can't build the user interface as this way.

Anyone can help? Thank you very much.

jaak
User offline. Last seen 1 day 9 hours ago. Offline
Joined: 06/19/2008

There are two ways: one is to use low-level graphics APIs and draw everything on the screen, and take care of locations and handling of all the different elements. More complex apps may require this approach. In this terms map is just a graphics object.

Another way is to use high-level UI API of Blackberry: Fields and FieldManager. See e.g. tutorial A11 from http://na.blackberry.com/eng/developers/resources/tutorials.jsp . Map could be defined as a custom Field and you can use this MapField custom field definition: MapField.java

It can be used in your app like that :

MapField _map = new MapField("Map", "abcdtrial", 
   "RIMFieldUIDemo", "Vendor", 320, 150, 
    new WgsPoint(24.764580, 59.437420),12);
 _fieldManagerMiddle.add(_map);
 _map.setDownloadStreamOpener(new DefaultDownloadStreamOpener(
  ";deviceside=true"));
 _map.startMapping();

/JaakL

matthewlcy
User offline. Last seen 2 years 1 week ago. Offline
Joined: 08/24/2009

Hi jaak, thanks for your help.

By the way, i have two new questions, hope you can spend some time to take a look.

1. If i use the MapComponent, can I add some pictures or icons above the map area?
2. Can I change the orientation of the map? (i.e. rotate the map 90 degrees clockwise)

Thanks.

jaak
User offline. Last seen 1 day 9 hours ago. Offline
Joined: 06/19/2008

1. Yes. If these are on map locations, then you can add Places to mapComponent. If these are UI buttons, then you should paint as overlay to the canvas, without involving MapComponent to it directly. But I'm not sure if overlapping UI elements are possible with custom Fields and FieldManager in Blackberry high-level UI.

2. Not inside MapComponent. However, some devices rotate whole application screen based on phone sensors automatically (e.g. Android, Nokia N95). Also map is rotated, and then you do not need to rotate map manually. Only thing to be checked is change of map size.

/JaakL