3

I use RichMapField like below to display Blackberry Maps in my application.

RichMapField map = MapFactory.getInstance().generateRichMapField(); 
add(map);

The map is displayed properly on the BlackBerry simulator, but on a device the map field is blank.

Edited:

This is some part of my code. The code given below adds 2 markers to the map, which works perfectly fine, but the only problem is i don't see the map.

  MapLocation Location1 = new MapLocation(coordinates[0],coordinates[1],"Location 1",null);
       int Location1ID = data.add((Mappable)Location1,"Location 1");
       data.tag(Location1ID, "Location1");

       MapLocation Location2 = new MapLocation(coordinates[0]-0.00009,coordinates[1]- 0.00009,"Location 2",null);
       int Location2ID = data.add((Mappable)Location2,"Location 2");
       data.tag(Location2ID, "Location2");     

       data.setVisible("Location");             
       map.getMapField().update(true)
Suppi
  • 630
  • 1
  • 7
  • 21

2 Answers2

0

Add the following:

map.getAction().setCentreLatLon(coordinates[0],coordinates[1]);
map.getAction().setZoom(0);

I think this way you will see the map now. For some reason I'm still investigating, the map.getAction().update(true); isn't working well for me too.

McDowell
  • 107,573
  • 31
  • 204
  • 267
Kshmire
  • 21
  • 1
  • 1
    Wow McDowell, was editing it just after posting it(first time fail) for code tags and you were already on it. Thanks. – Kshmire Jul 13 '12 at 08:54
-1

depends on your screen painting method. If your override your screen in such a way that u repaint ur screen on top of ur map, you obviously cant see the map.

Can you try pasting more code and ur paint method. It will help.

Nick
  • 1,692
  • 3
  • 21
  • 35
  • Hi Nick, i have added some code to the above question, i don't override on the screen, apart from adding the map and markers i add Menu Items. – Suppi Jul 07 '11 at 06:41
  • Well if it is working fine on simulator, it should work on the phone as well.. It must be a phone problem I think. Try testing on a different phone. Check GPS is turned on. – Nick Jul 07 '11 at 16:28