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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Regular Contributor
Posts: 95
Registered: ‎07-16-2010
My Device: 8520
My Carrier: bsnl

convertWorldToField() issue in non-touch os7

hii

 

i have use below code to set zoom leve according to screen size and map zoom level

 

issue :- on any touch device with any os7, on non-touch os5 code workinf fine only issue in non-toch with os7

this convertWorldToField(m,xy); use to give us
xy cordinate related zomm and lat long


code:

	private void setZoomLevel(MapLocation m, MapLocation[] marr) 
	{
		XYPoint xy = new XYPoint();
		XYPoint mxy = null;

		boolean mapzoom=true;

		while(mapzoom)
		{
			convertWorldToField(m,xy);
			boolean noforloop=true;
			for(int i=0;i<marr.length;i++)
			{
				mxy=null;
				mxy=new XYPoint();
				convertWorldToField(marr[i],mxy);
				System.out.println("=mxy"+i+"=>"+mxy.x+","+mxy.y);
				double ax=(xy.x-mxy.x);
				double ay=(xy.y-mxy.y);
				if(ax<0) 
					ax=ax*(-1);
				if(ay<0) 
					ay=ay*(-1);
				System.out.println("=zoom=>"+INITIAL_ZOOM+"     ax="+ax+"("+xy.x+"-"+mxy.x+")      ay="+ay+"("+xy.y+"-"+mxy.y);
				if(ax>(width/2) || ay>(height/2))
				{
					noforloop=false;
					INITIAL_ZOOM=INITIAL_ZOOM+1;
					if(INITIAL_ZOOM>=15)
					{
						mapzoom=false;
						noforloop=true;
					}
					setZoom(INITIAL_ZOOM);
					break;
				}
			}
			if(noforloop)
			{
				if(isFilterOnMap)
				{
					if(INITIAL_ZOOM>1)
					{
						INITIAL_ZOOM=INITIAL_ZOOM-1;
						setZoom(INITIAL_ZOOM);
					}
					if(INITIAL_ZOOM>=14)
					{
						INITIAL_ZOOM=4;
						setZoom(INITIAL_ZOOM);
					}
				}
				break;
			}
		}
	}

 

as per code consol log is :

 

m-> centerlocation where map is zoom

log of device 9360 os 7.0/7.1

vector mid point calculatiom============25.246208663639063=====55.30911072445806

=mlat-long=>25.274658746406264-55.32234191894531
=zoom=>1     ax=0.0(240-240)      ay=0.0(130-130
=mlat-long=>25.27411544548619-55.319037437438965
=zoom=>1     ax=0.0(240-240)      ay=0.0(130-130
=mlat-long=>25.274018427208787-55.319058895111084
=zoom=>1     ax=0.0(240-240)      ay=0.0(130-130
=mlat-long=>25.275202044893902-55.326905252295546
=zoom=>1     ax=0.0(240-240)      ay=0.0(130-130
=mlat-long=>25.276945919586613-55.31412094831467
=zoom=>1     ax=0.0(240-240)      ay=0.0(130-130

log of device 8900/8520 os 5.0

=mlat-long=>25.274658746406264-55.32234191894531
=zoom=>5     ax=37.0(239-276)      ay=88.0(130-42
=mlat-long=>25.27411544548619-55.319037437438965
=zoom=>5     ax=28.0(239-267)      ay=87.0(130-43
=mlat-long=>25.274018427208787-55.319058895111084
=zoom=>5     ax=28.0(239-267)      ay=86.0(130-44
=mlat-long=>25.275202044893902-55.326905252295546
=zoom=>5     ax=50.0(239-289)      ay=90.0(130-40
=mlat-long=>25.276945919586613-55.31412094831467
=zoom=>5     ax=14.0(239-253)      ay=96.0(130-34

--------------------------------------------------------------------------------------------

 

please help me to find solution for that ...................................thanks in advance..........!

Highlighted
Regular Contributor
Posts: 95
Registered: ‎07-16-2010
My Device: 8520
My Carrier: bsnl

Re: convertWorldToField() issue in non-touch os7

any replay?

 

its os7 issue?