Welcome!

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

Reply
Regular Contributor
Posts: 98
Registered: ‎03-10-2011
My Device: 9700 Bold

Adding Maps

Hi all,

 

How do I go about adding a simple map to my screen with a specific longitude and latitude? I have had a go at implementing a simple RichMapField using JRE 6.0 but this does not work on my Bold 9700. In order to code for my Bold 9700 I am having to use JRE 5.0 which is fine, but how do I implement a simple map in this environment?

 

Thanks

Regular Contributor
Posts: 98
Registered: ‎03-10-2011
My Device: 9700 Bold

Re: Adding Maps

 

       MapField _mapField;
       
       int _prevLat = 4328915;
       int _prevLon = -8032480;
             
       _mapField = new MapField();
       _mapField.setPreferredSize(_mapField.getPreferredWidth(),
         (int) (Display.getHeight() * 0.66));
       _mapField.moveTo(_prevLat, _prevLon);
       backgroundManager.add(_mapField);

 

 

Ok so I've managed to make some progress using the above code. My question now though is why does this code not work when I try to implement the coordinates I want to use which are:

 

Latitude: 51° 33' 18" North
Longitude: 0° 06' 30" West

 

How do I add these coordinates instead of the sample ones I have installed instead?

 

Thanks