Using Google Maps to show the geographical location of your website's visitors
Untitled Document
Part II – Getting Started
Keep in mind that this tutorial is not intended to show you exactly how to implement this solution. It is intended to give you a foundation of what you’ll need and give you some ideas. Part of the fun and the learning experience is figuring out better ways to do something, perhaps you’ll find ways to improve upon my implementation.
There is also a great deal of separation in this tutorial – ie, you could use all of my JavaScript, but do the backend in Java instead of PHP. Or, you could use PHP, but use Postgres instead of mySQL. Or, perhaps you like the way I build the XML, but you don’t like the way I lookup and store the Geocode – that is fine too.
There is rarely ever one exact right way to do something, I hope you’ll try to improve upon my code and optimize it the best for your situation. Now, lets start building this thing!
First, what are the steps we'll need to take in order to build this thing?
1 - We'll need to somehow record the IP of our visitor, get the approximate location of it (latitude/longitude), and store it.
2 - We need to return an XML document that we can use in our JavaScript to display the actual locations.
3 - We'll need to setup the actual map & code.
Part III – IP to Geocode >>
|