Plazes + XSLT = Google Maps

Peter Rukavina

This is a mostly working hack that uses XSLT to transform the [[Plazes]] “traces” XML file into a format suitable for feeding to Google Maps. I used a variety of Google Maps hacking sites to help me put this together. Because Google hasn’t published an API for this feature, it all exists in a shadowing alley world; enjoy at your own risk.

The result, which you can see live here, looks like this:

Sample of Google Map showing my Plazes locations

That’s a map, centred on Charlottetown, showing all of the Plazes that I’ve visited in the last 60 days. If you zoom way, way out, you’ll see additional Plazes in Montreal and Copenhagen too. Here are the building blocks:

I used TextXSLT on my Mac to transform the Plazes XML file using the XSLT file; there are a variety of other tools available for this, including the handy web-based W3C XSLT Service.

If you look at the source of the demo HTML file (substantially taken from Unofficial Google Maps Embedding How To), you’ll see it refers to “demo.xml,” which is where I saved the XML file that resulted from the transformation.

Notes on the result:

  • The XSLT file is somewhat more complicated by the fact that Google Maps needs latitude and longitudes expressed as positive (N and W) and negative (S and E) numbers while Plazes’ traces file uses positive numbers with N, S, E and W appended as appropriate.
  • The Plazes on the map are “clickable,” but the name and address of the Plazes don’t show up in Safari (they do show up in Firefox). Not sure why.
  • Some of the Plazes are showing up in the wrong location. This isn’t a problem introduced by the demo, or the fault of Google Maps: it appears to be a problem with Plazes’ geocoding system (wherein an address is translated into lat/lon coordinates). The Harborside near Delta Hotel Plaze shows up in the wrong place, for example, as does MarinaGrill.
  • The map is the barest possible example of a standalone Google Map: obviously there is much sophistication that could be added.

I can also imagine many ways in which this demo could be enhanced:

  • Different colors for “occupied” Plazes (would require a call to the Plazes server, somehow)
  • Pop-up could link to Plazes page, could show icons of Plazes users currently at that location, etc.
  • Could uses Google’s driving directions layer to show the “trace” — movement from Plaze to Plaze.

I welcome comments and suggestions for improvements and encourage others to build on this.

Comments

Submitted by Peter Rukavina on

Permalink

Looks like this demo, code from which I used to create my hack, is inoperable as well. Looking at Google Maps this morning it’s obvious there’s been a code upgrade (the “Map / Satellite” link is *on* the map now, for example), so I suspect this is the culprit.

Add new comment

Plain text

  • Allowed HTML tags: <b> <i> <em> <strong> <blockquote> <code> <ul> <ol> <li>
  • Lines and paragraphs break automatically.

About This Blog

Photo of Peter RukavinaI am . I am a writer, letterpress printer, and a curious person.

To learn more about me, read my /nowlook at my bio, listen to audio I’ve posted, read presentations and speeches I’ve written, or get in touch (peter@rukavina.net is the quickest way). 

You can subscribe to an RSS feed of posts, an RSS feed of comments, or a podcast RSS feed that just contains audio posts. You can also receive a daily digests of posts by email.

Search