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
Developer
Posts: 254
Registered: ‎03-15-2011
My Device: simulator
My Carrier: simulator

Re: Blackberry maps

When you get the grey area, did you try to zoom out and check if the map is rendered properly?

 

You do not have setZoom in RichMapField.

 

Is your requirements is to show only one point of interest on the map?

------------------------------------------------------------------------------------------------
Click "Accept as Solution" if post was what you needed. Give kudos if you feel response is helpful.

Contributor
Posts: 25
Registered: ‎04-07-2011
My Device: All
My Carrier: Any

Re: Blackberry maps

If I zoom out I can see the map (although the redering is poor).
Currently, it is to only show one poimt, I'll probably need to increase to 2 soon.
Many thanks!
Developer
Posts: 254
Registered: ‎03-15-2011
My Device: simulator
My Carrier: simulator

Re: Blackberry maps

The RichMapField has the property to set the Zooming level adjust automatically  to show the Pointers display on the blackberry device screen.

 

In the case you have tried, you have only one pointer and the RichMapField has applied the Maximum zoom to it. That is the reason you get your pointer in grey area.

 

If you use more than one pointers, the zoom level is adjusted to show all the pointers on the device screen and this case you will not face the grey issue as that pointers might be atleast some distance away from eachother.

 

So I would suggest you to proceed with multiple pointers.

 

rMap

.getMapField().update( true );  --> This is the code to update the zooming level automatically according to the device screen. This is special feature of RichMapField. If you dont want that, you can make it false

------------------------------------------------------------------------------------------------
Click "Accept as Solution" if post was what you needed. Give kudos if you feel response is helpful.

Contributor
Posts: 25
Registered: ‎04-07-2011
My Device: All
My Carrier: Any

Re: Blackberry maps

I'll try that- in the mean time
I've found the method
action.setCentreAndZoom(new MapPoint(DEFAULT_LAT,DEFAULT_LONG),2);
what does the stand 2 for- I've just tried 10 and it works fine, although it shows 1/2 of the Uk- not very useful!
Highlighted
Developer
Posts: 254
Registered: ‎03-15-2011
My Device: simulator
My Carrier: simulator

Re: Blackberry maps

The Zoom Level varies from 0 and 15.

 

0 -- Means Maximum Zoom out

15 -- Means Maximum Zoom in (This 15 was set in ur case and you got the grey area on the screen)

 

 

Could you try the below code by giving the DEFAULT_LAT,DEFAULT_LONG value as the latitude and longitude that you mentioned above (So that your location is centeralised on the device screen) and zoom level as 14 or 13.

 

action.setCentreAndZoom(new MapPoint(DEFAULT_LAT,DEFAULT_LONG),13);

------------------------------------------------------------------------------------------------
Click "Accept as Solution" if post was what you needed. Give kudos if you feel response is helpful.

Developer
Posts: 254
Registered: ‎03-15-2011
My Device: simulator
My Carrier: simulator

Re: Blackberry maps

Does this solve your issue?

------------------------------------------------------------------------------------------------
Click "Accept as Solution" if post was what you needed. Give kudos if you feel response is helpful.

Contributor
Posts: 25
Registered: ‎04-07-2011
My Device: All
My Carrier: Any

Re: Blackberry maps

Hi
Sorry- I'm juggling a few projest at the moment!
I'll test it now.
Contributor
Posts: 25
Registered: ‎04-07-2011
My Device: All
My Carrier: Any

Re: Blackberry maps

Sorry- but i'm still trying to get it to give meaningful results.
just to check-
should I be using
map.getMapField().update( false );
or
map.getMapField().update( true );
if using
action.setCentreAndZoom(new MapPoint(DEFAULT_LAT,DEFAULT_LONG),13);
Developer
Posts: 254
Registered: ‎03-15-2011
My Device: simulator
My Carrier: simulator

Re: Blackberry maps

To be very clear, map.getMapField().update( true); is used to automatically set the center and zooming factor.

 

But in your case when you want that to be pre defined using action.setCentreAndZoom(new MapPoint(DEFAULT_LAT,DEFAULT_LONG),13); (where the DEFAULT_LAT= 51.060130,DEFAULT_LONG=-1.339557
) you should not give the update value as true.

 

Means,  map.getMapField().update( false); should be used

------------------------------------------------------------------------------------------------
Click "Accept as Solution" if post was what you needed. Give kudos if you feel response is helpful.

Contributor
Posts: 25
Registered: ‎04-07-2011
My Device: All
My Carrier: Any

Re: Blackberry maps

I've tried this several times now
but with
action.setCentreAndZoom(new MapPoint(DEFAULT_LAT,DEFAULT_LONG),14);
map.getMapField().update( false );

I get a map of the whole of Europe- that can't be right for this zoom level, can it?