File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Displaying Location map on JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Displaying Location map on JFrame" Watch "Displaying Location map on JFrame" New topic
Author

Displaying Location map on JFrame

Girish Vasmatkar
Ranch Hand

Joined: Apr 24, 2008
Posts: 199
Hello to all Ranchers,

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...

-- Girish --
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36514
    
  16
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.
Girish Vasmatkar
Ranch Hand

Joined: Apr 24, 2008
Posts: 199
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
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36514
    
  16
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying Location map on JFrame
 
Similar Threads
Editing URL of an Application
Policy file question and readme question
can we detect location if GPS is not accesible
Can't access J2EE web app
Blocking IP addresseses