18 June 2008

Map Website Visits


One frequent request from users of my little Flash map is a way to map traffic to their website. So here it is. The map above displays a week of traffic to the map home page.

I adapted the geocounter PHP script to query the hostip.info API and convert IP address to latitude and longitude and store the location in a database.

There are a few tools that map traffic by adding dots to a PNG or markers to an embedded Google map, but I find these cluttered and cumbersome. My map does a few things differently:

  • With a single click, zoom into a cluster of points to see a finer, more detailed view. No more bouncing to Google or fiddling with a lot of navigation buttons. You can also click-and-drag to zoom into a specific selection, or click on the edge of the frame to move around.
  • Additional traffic increases the total area of the dots proportional to the number of hits you get, not just doubling diameter with each subsequent hit.
  • Points fade over time as the traffic record ages.
  • Traffic from the same location over multiple days is represented by concentric circles, older visits shown in outer rings that fade over time.
  • You can customize colors of the points, background, countries and borders. For instance, see darker, analog-style version on the map home page.
  • You can configure the how long you want to store traffic data, and the minimum size of the points.

The geocounter script is GPL’ed and the map is free for personal or non-profit use, but requires a license for commercial use. For more information visit http://backspace.com/mapapp/.

Download the PHP scripts and world map at http://backspace.com/mapapp/geocounter.zip.

It's been thrilling watching traffic show up from far-flung places. Sort of takes me back to the old web odometer days. Enjoy!