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
rajeshkparmar
Posts: 104
Registered: ‎08-03-2010
My Device: Blackberry Z10
My Carrier: Idea
Accepted Solution

Need Box Lat Long in MapField OS6.0

Hi Everyone,

 

I want to find the left,right,top, bottom latitude longitude from Map,

I have used the 6.0 API MapDimentions and MapField.

By using ,

  mapDimentions.getbottom(); //it will give me the bottom coordinate. or like getleft,gettop....

 

but it would not change when i moved the map.

 

i need a box coordinate or lat lon(all four) and also it will change when map moved..

 

Thanks,

 


Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you
Please use plain text.
Developer
jprofitt
Posts: 604
Registered: ‎12-27-2010
My Device: Not Specified

Re: Need Box Lat Long in MapField OS6.0

You use convertFieldToWorld and use the 4 corners of the screen (in pixels) to get the appropriate map lat/lon coordinates.

Please use plain text.
Developer
rajeshkparmar
Posts: 104
Registered: ‎08-03-2010
My Device: Blackberry Z10
My Carrier: Idea

Re: Need Box Lat Long in MapField OS6.0

Hi,

No.i am not using that but i can try for that,

thanks

 

any other comments.

 

Actually i am just test the OS 6.0 MapDimention class and its getboundry Method..

 

 

 


Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you
Please use plain text.
Developer
rajeshkparmar
Posts: 104
Registered: ‎08-03-2010
My Device: Blackberry Z10
My Carrier: Idea

Re: Need Box Lat Long in MapField OS6.0

Hi ,

 

getboundry return the

left

right

below

and

top

cordiantes but it was static..

 

i want to get the four corner or four side data in dynamic manner like if i am scrolling the map than that data will be change by approciate  mapfield data..

 


Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you
Please use plain text.
Developer
rajeshkparmar
Posts: 104
Registered: ‎08-03-2010
My Device: Blackberry Z10
My Carrier: Idea

Re: Need Box Lat Long in MapField OS6.0

Hi

 


How should i get the 4 corners lat lon using convertFieldToWorld?

can you give me some hint or comments?

 

Thanks..


Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you
Please use plain text.
Developer
jprofitt
Posts: 604
Registered: ‎12-27-2010
My Device: Not Specified

Re: Need Box Lat Long in MapField OS6.0

Here's the first corner:

 

 

//Just creating a new Coordinates object, the values don't matter
Coordinates topLeft = new Coordinates(0,0,Float.NaN);
//The field point in pixels that you want to convert, this is where you put your four corners
XYPoint coords = new XYPoint(0, 0);
convertFieldToWorld(coords, topLeft);

 

 

After this topLeft will have your latitude and longitude of the top left corner of your map. Hope this helps!

Please use plain text.
Developer
rajeshkparmar
Posts: 104
Registered: ‎08-03-2010
My Device: Blackberry Z10
My Carrier: Idea

Re: Need Box Lat Long in MapField OS6.0

hi jprofitt

Thanks for the Help..

 

Can you know about the MapDimention and getboundrybox() in 6.0 ?

 it will also give me a 4 side cordiante..

it will display just +- boundry of latititude..

eg. like -76.1234 to 76 1234

 

it will not change when i m move the map..

 

Thanks...


Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you
Please use plain text.
Developer
jprofitt
Posts: 604
Registered: ‎12-27-2010
My Device: Not Specified

Re: Need Box Lat Long in MapField OS6.0

I've only used the MapField in 5.0 so unfortunately I'm not experienced with that object/method.

Please use plain text.
Trusted Contributor
milanvishal
Posts: 201
Registered: ‎12-17-2010
My Device: Not Specified

Re: Need Box Lat Long in MapField OS6.0

hi, can you send your map field demo please ? so that i can get more idea about map. please send just demo code of it so that i can get the actual idea about map. Thanks & Regards
Please use plain text.