Google Maps + Microformats!

Turns out Google Maps are even better when they include Microformats.  This is great news from Google.  Specifically, they are using the hCard microformat.  Very nice!!!

You can get the benefits of microformats for your own maps applications if you change your HTML to contain the necessary hcard classes. In this simple example, we’ve changed the infowindow to contain an hCard formatted address. The code for that is below:

  var html = '<div class="vcard"> <span class="adr">'
             + '<span class="fn n">Googleplex<br />'
             + '<span class="street-address">1300 Amphitheatre Parkway</span><br />'
             + '<span class="locality">Mountain View</span>, '
             + '<abbr class="region" title="California">CA</abbr>'
             + '<span class="postal-code">94043</span>'
             + '</span> </div>';
  map.openInfoWindowHtml(map.getCenter(), html);
Big in Japan | July 31st, 2007, 3:56 pm | Tags: microformats | Bookmark on del.icio.us | Digg It | share with: elfURL
You can leave a response, or trackback from your own site.

Leave a Reply







© 2005-2007 Big in Japan, an Architel company. All Rights Reserved. RSS Feed
1950 Stemmons Freeway, Suite 2022 • Dallas, Texas 75207 • 214.550.3600 Office 214.550.2001 FAX