This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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: 62883
203
  • 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: 62883
203
  • 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.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!