Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 208
Registered: ‎08-04-2009
My Device: Not Specified

Re: Blackberry maps

you should post every new problem in new thread, so can other programmers can find a solution, or even suggest a solution.



Regular Contributor
Posts: 94
Registered: ‎05-29-2010
My Device: 9000 bold
My Carrier: asfas

Re: Blakberry maps

Hello Mr Jitendra Sharma.

 I tried using your MultiMapField class but i am not able to resolve InfoTraceRoute. Is it your Custom class. If so can you please share it too.

Posts: 11
Registered: ‎08-18-2010
My Device: Not Specified

plz send InfoTraceRoute

Hi Sir

 plz send InfoTraceRoute class in customMapField.

Thanks & Regards



Trusted Contributor
Posts: 201
Registered: ‎12-17-2010
My Device: Not Specified

Re: Blackberry maps

Hello sir,


I want to get the lat & long clicking on map.

i write below code in custmo map field but i cant get the value of it.

I tried by debugging code but the debugger not go in the method.

so please help me to come out from this issue.


Thanks & Regards




protected boolean navigationClick(int status, int time) {
 int lat = getLatitude();
 int lang = getLongitude();
 System.out.println("Lat :~~~~~~~~~~~~~~~~>" + lat);
 System.out.println("Lang :~~~~~~~~~~~~~~~~>" + lang);
 return super.navigationClick(status, time);


Trusted Contributor
Posts: 201
Registered: ‎12-17-2010
My Device: Not Specified

Blakberry maps

Hello Mr. Jitendra Sharma Sir,


can you please give me a favour ?

can you please send your InfoTraceRoute.java custom class mail me on mlnmodi@gmail.com?


Thanks & Regards



Trusted Contributor
Posts: 201
Registered: ‎12-17-2010
My Device: Not Specified

Re: Blakberry maps

Hello Sir,


I want to get the latitude & longitude of map.


Now I click on map any where i get the center of map's latitude & longitude.


But I want to get the latitude & longitude of map where i clicked on map.


So please any one has any idea please help me to solve my issue.


Thanks & Regards

Posts: 21
Registered: ‎04-21-2011
My Device: Developer
My Carrier: ----

Re: Blackberry maps

Hi ,

 I have been trying to implement pretty much the same thing. But  i also want to include PAN ans ZOOM options through trackball and keypad respectively.

  I have  tried  the following


boolean navigationMovement(int dx, int dy, int status, inttime)


boolean b = false;

dx = dx << 3;

dy = dy << 3;

// Allows smoother panning on the map.if (Trackball.isSupported())


// Adjust the filter.






mapField.mf.move(dx*10, dy*10);



// Delegates this task to the map instance.returnb;


protectedboolean keyDown(int keycode, inttime) {


int key=Keypad.key(keycode);


//String keyname= String.valueOf(Keypad.map(key, status));

String keyC=Integer.toString(key);


out.println("********************************* key pressed"+key);


out.println("********************************* key pressed to string"+keyC);


returnsuper.keyDown(keycode, time);


publicboolean keyChar(char key, int status, inttime)



out.println("inside keychar");


boolean retval = false;


int zoom=mapField.mf.getZoom();

if(key== 'o'||key== 'O')





retval = true;










  I  have over ridden these methods inside the  place where I am calling the multimap manager.

Also this is the implementation of my multimap manager.Please tell me if  I am doing anythin wrong.As  I m unable to view certain location s and also zoom through touch event also doe snot work all the time.


import javax.microedition.location.Coordinates;

import net.rim.device.api.lbs.MapField;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.XYPoint;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.container.AbsoluteFieldManager;
import net.rim.device.api.util.Arrays;

public class MultiMapLocManager extends AbsoluteFieldManager{
 Coordinates[] mPoints = new Coordinates[0];
 Bitmap mPoint;
 public  MapField mapField;
 boolean bitmapInLocationFlag[];
 BitmapField field[];
 int coordinatedCount;

 public MultiMapLocManager(int count,Bitmap mPoint) {
  mapField=new MapField();
  bitmapInLocationFlag=new boolean[count];
  field=new BitmapField[count];
  for(int i=0;i<count;i++){
   field[i]=new BitmapField(Bitmap.getBitmapResource("red-pin.png"));


 public void addCoordinates(Coordinates coordinates) {
  Arrays.add(mPoints, coordinates);
 protected void zoomToFitPoints() {
  // zoom to max

  // get pixels of all points
  int minLeft = getWidth();
  int minUp = getHeight();
  int maxRight = 0;
  int maxDown = 0;
  Coordinates minLeftCoordinates = null;
  Coordinates minUpCoordinates = null;
  Coordinates maxRightCoordinates = null;
  Coordinates maxDownCoordinates = null;
  for (int i = 0; i < mPoints.length; i++) {
   XYPoint point = new XYPoint();
   mapField.convertWorldToField(mPoints[i], point);
   if (point.x <= minLeft) {
    minLeft = point.x;
    minLeftCoordinates = mPoints[i];
   if (point.x >= maxRight) {
    maxRight = point.x;
    maxRightCoordinates = mPoints[i];
   if (point.y <= minUp) {
    minUp = point.y;
    minUpCoordinates = mPoints[i];
   if (point.y >= maxDown) {
    maxDown = point.y;
    maxDownCoordinates = mPoints[i];

  double moveToLat = maxDownCoordinates.getLatitude()
  + (minUpCoordinates.getLatitude() - maxDownCoordinates
    .getLatitude()) / 2;
  double moveToLong = minLeftCoordinates.getLongitude()
  + (maxRightCoordinates.getLongitude() - minLeftCoordinates
    .getLongitude()) / 2;
  Coordinates moveTo = new Coordinates(moveToLat, moveToLong, 0);
  // zoom to min left up, max right down pixels + 1
  int zoom = mapField.getZoom();
  boolean outOfBounds = false;
  while (!outOfBounds && zoom > mapField.getMinZoom()) {
   XYPoint point = new XYPoint();
   try {
    mapField.convertWorldToField(minLeftCoordinates, point);
    if (point.x < 0)
     outOfBounds = true;
    mapField.convertWorldToField(minUpCoordinates, point);
    if (point.y < 0)
     outOfBounds = true;
    mapField.convertWorldToField(maxRightCoordinates, point);
    if (point.x > getWidth())
     outOfBounds = true;
    mapField.convertWorldToField(maxDownCoordinates, point);
    if (point.y > getHeight())
     outOfBounds = true;
   } catch (IllegalArgumentException ex) {
    outOfBounds = true;

 protected void paint(Graphics graphics) {
  if (null != mPoint) {
   for (int i = 0; i < mPoints.length; i++) {
    XYPoint fieldOut = new XYPoint();
    mapField.convertWorldToField(mPoints[i], fieldOut);
    int imgW = mPoint.getWidth();
    int imgH = mPoint.getHeight();
    add(field[i],fieldOut.x - imgW / 2, fieldOut.y - imgH);






Please guide me  jitendra...  Thanks in advance.

Posts: 18
Registered: ‎11-16-2011
My Device: 9900
My Carrier: blackberry

Re: Blakberry maps

[ Edited ]

Hi Jitendra Sharma, I gone through this forum for map. I am also new to Blackberry and i have to show the same multiple location point on map. But i don't know how to do that what extra thing i have download. Please guide me how to implement that. Also please provide me the InfoTraceRoute.java custom class on my personal  I shall be very very very thanksfull to you. Please help me Its urgent for me. Hope you understand and help me to get out of this. Thanks in Advance Rahul