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);
Leave a Reply