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 »

What functionality is lost by using the RIM Blackberry API versus the MIDlet version?

3 replies [Last post]
eborisow
User offline. Last seen 2 years 30 weeks ago. Offline
Joined: 05/19/2009

Hi,

I was just wondering what functionality loss is there between the RIM Blackberry version of the MGMaps API versus the MIDlet version of the API. I see that one uses MapItems vs. using a MapComponent. Is there anything that you cannot do with MapComponent that could be done with MapItem?

Thanks,
Eric

admin
User offline. Last seen 2 years 6 weeks ago. Offline
Joined: 05/08/2008

MapItem is based on MapComponent, and they have almost all the same methods with same functionality. Internal difference is that MapItem is custom item in terms of LCDUI Forms, from that there are couple of things:
a) you can add MapItem to Form, but cannot add MapComponent
b) MapItem cannot get cursor/joystick button keypresses (as these are used for changing focus between Form items. These can be critically important for map movement (unless you have touchscreen), so this is the reason why usually MapComponent is used on Canvas.

Quick conclusion: use MapComponent, unless MapItem is really necessary.

eborisow
User offline. Last seen 2 years 30 weeks ago. Offline
Joined: 05/19/2009

Hi Jaak,

Thank you for your reply. So, my first assumption is that MapItem is not available to the Blackberry API. (I was just basing that assumption on the example for Blackberry; not sure if that's true or not).

So, based on my assumption, here is what I'm trying to do and maybe you can tell me if it's possible. We would like to display a location on a map with a few locations with pins near the current location. Then, the person should be able to select one of the locations by clicking on it with the BB trackball. The map would capture the lat/long of the current location and we would be able to do something with that data in our application.

Can you tell me if the MapComponent has that capability? It sounds like it may not.

Thanks!

Regards,
Eric

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

Yes, this is possible.
1. Create map (using MapComponent)
2. Add Places as markers (addPlace method)
3. Implement PlaceListener interface methods (important for you is placeClicked). Something like:

public void placeClicked(final Place p) {
System.out.println("Clicked place id: " + p.getId() + " place name: " + p.getName());
}

4. Make sure that trackball events are forwarded to map moving events, in UIApplication you need to implement navigationMovement method for it, something like

protected boolean navigationMovement(final int dx, final int dy, final int status, final int time) {
mapComponent.panMap(dx * 10, dy * 10);
invalidate();
return true;
}

Also you need to make sure that selection key is defined (defineControlKey) with device's select key code.

5. User can use trackball to pan map, when cursor (center point) is over object and clicks "select", then mapComponent calls PlaceClicked method.

I suggest to take a look to the J2ME samples which included in the library package. From maps library API usage point of view these are valid also for BlackBerry UIApplication. E.g. Mapper sample includes place drawing and handling, something similar what you may want here

/JaakL