geo2web.com

Review of GIS GPS GEO and MAPs technology

geo2web.com header image 2

Microformats in Google Maps

November 19th, 2007 · No Comments · Google Maps API News, Manuals, Maps, Mashups, Microformats

::: via :::


If you have spent any time in certain corners of the web, you will have heard of Microformats: Clever uses of HTML that add machine-readability to everyday web pages while preserving human-readability. Microformats allow tools to make more sense of your web pages, while not changing the visual appearance for visitors to your site one whit.

Today we’re happy to announce that we are adding support for the hCard microformat to Google Maps results. Why should you care about some invisible changes to our HTML? By marking up our results with the hCard microformat, your browser can easily recognize the address and contact information in the page, and help you transfer it to an addressbook or phone more easily. Firefox users can install the Operator or Tails extension; IE or Safari users can use one of these bookmarklets.

If you are on a Mac, and want to export a search result to your address book, this is how it looks:







Using Microformats in your Maps API application

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> <span>' + '<span>Googleplex<br />' + '<span>1300 Amphitheatre Parkway</span><br />' + '<span>Mountain View</span>, ' + '<abbr title="California">CA</abbr>' + '<span>94043</span>' + '</span> </div>'; map.openInfoWindowHtml(map.getCenter(), html);

If you want to learn more, head over to microformats.org.

Tags:

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

You must log in to post a comment.