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
MohammedAziz
Posts: 139
Registered: ‎02-23-2012
My Device: Blackberry bold

To display a Map View

HI All,

 

Please check the below code

MapView view = new MapView();
				view.setLatitude((int) (17.42329160139295));
				view.setLongitude((int) (78.46238136291504));
				view.setZoom(0);
				MapsArguments args = new MapsArguments(view);
				Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, args);

Is it right code to display that particular coordinate on BB map, because it is displaying nothig

 

Thank you

 

warm regards
Mohammed Aziz
Please use plain text.
Developer
simon_hain
Posts: 16,190
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: To display a Map View

Parameters:
latitude - The latitude (100,000 times the value specified by WGS84)

currently your coordinates are 17 and 78 after being casted to int, better remove the dot i think.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
MohammedAziz
Posts: 139
Registered: ‎02-23-2012
My Device: Blackberry bold

Re: To display a Map View

view.setLatitude((174228989));
view.setLongitude((784619748));

No its not working....
warm regards
Mohammed Aziz
Please use plain text.
Developer
simon_hain
Posts: 16,190
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: To display a Map View

check the number of digits.
see the sample in http://www.blackberry.com/developers/docs/7.1.0api/net/rim/blackberry/api/invoke/MapsArguments.html which has 4,367,022, while you have 784,619,748
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
MohammedAziz
Posts: 139
Registered: ‎02-23-2012
My Device: Blackberry bold

Re: To display a Map View

Sir

I am not getting data connectivity on simulator, even though my system in connected with internet.

I told by my senior that BB maps never display on simulator but with the same code (cod file) it will work fine on real device.
warm regards
Mohammed Aziz
Please use plain text.
Developer
simon_hain
Posts: 16,190
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: To display a Map View

did you start the mds simulator?

in the end, the real device is what matters. did you resolve your issue?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
MohammedAziz
Posts: 139
Registered: ‎02-23-2012
My Device: Blackberry bold

Re: To display a Map View

Yes, But I think I need to test it on device

I will do it and let you know

Thank you SIr
warm regards
Mohammed Aziz
Please use plain text.