BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/index.php)
-   Developer Forum (http://www.blackberryforums.com/forumdisplay.php?f=15)
-   -   need help with blackberry maps (http://www.blackberryforums.com/showthread.php?t=135418)

thewarlock 06-16-2008 04:02 PM

need help with blackberry maps
 
Hey everyone,

I am making an application that launches blackberry maps from a location document on a server. I would multiply the latitude and longitude by 100,000 as per the documentation but I've run into a problem. The blackberry throws an error when the lat or long is XXX.XXXXXX (e.g. -118.392848). Can anyone tell me how to fix this?

hrbuckley 06-16-2008 07:42 PM

Quote:

Originally Posted by thewarlock (Post 973704)
Hey everyone,

I am making an application that launches blackberry maps from a location document on a server. I would multiply the latitude and longitude by 100,000 as per the documentation but I've run into a problem. The blackberry throws an error when the lat or long is XXX.XXXXXX (e.g. -118.392848). Can anyone tell me how to fix this?

Hard to give specific help without a code snippet, or the Exception thrown, but some times the order of casting is important to prevent overflows. This snippet works as expected:
Code:


        double lon = -118.392848;
       
        int l = (int)(lon * 100000.0);



All times are GMT -5. The time now is 05:01 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.