Set up world map with click locations

Posted on 2007-11-22
Last Modified: 2013-12-26
I am trying to set up a one page web site with the following:
*Large image of a World Map
*I want most or all of the worlds cities mapped invisibly into the pixels.
*When you click a pixel the site tells you how far you are from selected location.

How would you recommend doing this preferably using php and mySQL.
Can use other format but no flash.

Thanks a lot!
Question by:lsternlicht
  • 3
  • 2
  • 2
  • +1
LVL 16

Expert Comment

ID: 20336419
This is not a trivial task!

Lot's of maths etc...

Have you considered Google Maps, there is a programming API which with a little thought will give you exactly what you need.
LVL 16

Expert Comment

ID: 20336430
For a starters, have a look at this page for a guide on the required maths:-
LVL 16

Expert Comment

ID: 20336432
Should have said you don't need the maths for GoogleMaps it will do it for you.

Author Comment

ID: 20336624
no, not googlemaps, i need this from my own image on an html page
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 20339775
to have dynamic cities and details, better use google maps or yahoo maps allows everything..,

Author Comment

ID: 20379605
logudotcom, how would i do this?
LVL 36

Accepted Solution

Loganathan Natarajan earned 250 total points
ID: 20379844
First look at the complete API specification at

then look the samples at

with PHP - MySQL db integrated...

Assisted Solution

Valane earned 250 total points
ID: 21068587
Using geo-targeting (Usually through HTTP variables) you could probably pre-define the users position on a grid (your world map) and use javascript through AJAX to return a users click position in X/Y coordiniates, with that, you would then have to work out the length that a pixel would convert to in real world terms (1 pixel = 234.6 miles) then use the pre-definded coordiniates versus the new click coordinates to calculate the distance.

You may even be able to use PHP's GD library to create a "line" from start to finish locations on your world map if you generate the map dynamically.

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
Introduction This article is intended for those who are new to PHP error handling (  It addresses one of the most common problems that plague beginning PHP develop…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now