views:

65

answers:

2

I've been bored lately and I want to start a new project. I was looking at a website mentioned in a different question (http://www.grapevinegame.com/), and I thought the map and how it plots a point based on someone's IP (I assume) is pretty nifty. I want to do something like that, but I have no idea how it's done. I know you can get latitude and longitude, city and state, and some more with some already-written scripts, but how would you plot those on a map of the world? I've seen it other places, like Google Analytics and such, as well.

It seems like a neat thing to be able to do, so I was just wondering how exactly to go about doing it. (Plotting the locations on a map and "drawing" a route between them.)

+4  A: 

Given latitude and longitude, it's just a matter of using a map API, like Google Maps API, to display a set of points (where a point is a lat/lng pair) in a browser. Did you have a more specific question?

Matt Ball
Well, I want to be able to show multiple points and show a path between them, much like that grapevinegame.com website.
Andrew
GMaps API can be used to show more than one marker, as well as drawing lines between points (not to mention totally arbitrary lines).
Matt Ball
Or are you trying to write this sort of map drawing yourself without using an API?
Matt Ball
Well, I suppose not. If Google Maps will work, then that'll be fine. But won't it show the route as an actual driving route? How will that work if one point is in in the US or England, and one is in Australia or something? =/.
Andrew
No, driving directions are something completely separate. Go have a look around the [GMaps API examples](http://code.google.com/apis/maps/documentation/examples/index.html) - like [this one](http://code.google.com/apis/maps/documentation/examples/polyline-geodesic.html), for example.
Matt Ball
Oh, well, that'll work then! Thanks. :-p.
Andrew
A: 

I also agree that you can use the Google Map API together with some geolocation service provider for the data to plot out the what you want on the map. You can give a try to study manual from Google Map API.

If you are looking for geolocation service, I think you can get accurate data from IP2Location, it has been used by most comprehensive company around the world for detecting IP address

SuperRomia