Google Maps: why are you so difficult?
So recently a friend asked me if I could map a list of ip addresses to physical real-world locations. I thought this would be a somewhat simple en devour, but little did I know what the universe had in store for me.
My first step was seeing how to map ip addresses to a location. This was the easiest part using Host.info. This site provides an easy to use api and fairly accurate results. It’s always nice having open source solutions for problems like this.
The next step was taking these locations and putting them on a map. This is where Google and its almost infinite tools come into play. I have used their search api before, which really sucks since they moved to the AJAX model, and I mistakenly thought the examples would give me everything I need. The basic setup is the same but the data formats Google used in the examples (KML or XML) did not provide a basic structure that Google maps api would render correctly. Looking around their api and searching the internet didn’t get me anywhere either.
At one point, I found someone who developed their own solution by using Google’s XML Javascript object. This made it really easy to get any information I need and allowed me to use any accepted XML standard, applying a location/marker tag and displaying the result and any contextual information. I’m glad Google provides this functionality but they could do a little better in providing a standard for their data formats. That, or I am a total dunce and totally missed that information.