This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have some problem regarding displaying a map on the JFrame which will display the location information of a particular user based on the IP address. I have developed a program which gets the location from the IP address of the user but i kinda stuck on how to show it on the Map which will be contained on the JFrame. Plese suggest me some solution for this as this will be of great help. Thanks in advance...
Do you get latitude and longitude from the IP database? Do you have a size for the map? You can work out the x location from longitude * width /360 + width / 2 which will probably work out as a double. Latitude is similar only you divide by 180.
Joined: Apr 24, 2008
Originally posted by Campbell Ritchie:
Do you get latitude and longitude from the IP database? Do you have a size for the map?
Sir actually i am getiing the IP address of the machine and a database i am using which gives me location information such as Lattitude and Longitude but now i want this information to be used in such a way that i get a Map which shows the location of the user and this Map be displayed on my JFrame.The size of the Map would be the size of my JFrame or somewhat smaller...
Thank you very much for your reply
Joined: Oct 13, 2005
Try what I suggested; I think you have enough information to start. If the map doesn't show the whole world, the arithmetic will be more complicated. If it is a Mercator's projection the y values won't run linearly.