• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Displaying Location map on JFrame  RSS feed

 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 --
 
Marshal
Posts: 60895
190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 60895
190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!