[uf-discuss] Mashup a Web page containing geo microformats with
Google Earth?
Jeremy Keith
jeremy at adactio.com
Fri Nov 3 04:58:46 PST 2006
Roger Costello wrote:
> Suppose I have an ordinary HTML web page. Embedded in the web page
> are
> a number of geo microformats. The web page has a link to, say, a
> Javascript file. When the web page is loaded in a browser, the
> Javascript is automatically invoked and extracts all the geo
> Microformats, mashes them with Google Earth, and then displays a
> Google
> Earth map on the browser screen with dots at the locations where the
> geo microformats indicated.
Yes, this is exactly the kind of thing I want to do to encourage more
people to use microformats. I've been messing around with this, as
Brian said:
> There is also a pure DOM Javascript version by Jeremy Keith here: (you
> can view source to see how it works) It used hCards/hCalendar and GEO
> to mash-up google maps.
> http://austin.adactio.com/
It runs through the DOM, looks for elements with a class of "vcard",
and then looks in there for abbr elements with a class of "geo" and
then splits the title attribute on the semi-colon. I just did it
again in a blog post, though Firefox seems to be having issues with
Google's JavaScript:
http://adactio.com/journal/1200/
I'd love to put this out there for anyone to use, y'know: "add geo-
coded hcards to your page and automatically get a Google map: just
add this script tag."
But, and this is a big but, Google Maps demands that you have a
unique application ID for each domain. That means anyone who wants to
do something like this on their own site would have to generate an
app ID at Google: that's quite a few hoops to jump through.
I'll investigate other mapping providers (Yahoo!, MSN, Multimap,
etc.) and see whether it would be any different.
Thinking about it, demanding the use of the geo microformat might
even be redundant in some countries like the USA: Google Maps (and
others) have geo-lookups built into the API now, so a good adr in an
hcard would be enough. Alas, living in the UK, these luxuries are not
afforded to us.
Thank goodness for OpenStreetMap. :-)
> Care to share how you did it?
Go ahead and look at the JavaScript here:
http://adactio.com/extras/JavaScript/micromap.js
If you have any questions, let me know.
Bye,
Jeremy
--
Jeremy Keith
a d a c t i o
http://adactio.com/
More information about the microformats-discuss
mailing list