开发者

BlackBerry RichMapField is blank on device

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.ta开发者_StackOverflow社区g(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)


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜