« Finding tag intersections | Main | Iteration 2 Prototype Review »

The Google Maps API

A number of groups are using the google maps API.  The API documentation itself seems good, with examples and all, but it might be kind of dense.  I have a series of simple examples that I downloaded as part of an e-book ($8.50 at Pragmatic Programmer).  They're here.

 Here's a little guide to what they are all about:

  • Files 1–5.html:  Show basic map set up.  Everyone has pretty much mastered this.  The e-book gives a nice user-friendly walk-through.
  • Files debug1–5.html:  Show how to turn on and off various map controls.  They also illustrate how to programatically control the map interface.
  • Cities-nomap.html illustrates how to create a table using an input form.  It's purely DOM manipulation and provides background for what is to come.  No maps are involved.
  • cities-map1–2.html:  Show how to add markers for cities when you know the lattitude and longitude.
  • cities.html looks up address lattitude and longitude using a third party geocoder.  This has been a sore point for a number of groups.  It requires using a pass-through proxy.  Currently, you can run those on yipe using php.  Google maps does not provide access to its geocoder.  You must use one from a third party.  Warning! My file does not use the pass-through proxy because I am not hosting it on yipeTherefore, my file does not work.
Regarding the last point, there are a number of geocoders.  Here's a list:
  • geocoder.us: Works for US locations.
  • Maxmind has a 137MB list of city addresses with latitude and longitude.  This will surpass your directory allocations, but you should be aware of the resource.
  • Worldkit provides a geocoder for world locations like geocoder.us does for US locations.

Post a comment

Tag cloud

Archives