<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="5.0" xmlns="http://docbook.org/ns/docbook">
<info>
  <title>Mapping photographs</title>
  <biblioid class="uri">http://norman.walsh.name/2008/03/26/mappingPhotographs</biblioid>
  <volumenum>11</volumenum>
  <issuenum>33</issuenum>
  <pubdate>2008-03-26T14:27:04-04:00</pubdate>
  <author>
    <personname>
      <firstname>Norman</firstname>
      <surname>Walsh</surname>
    </personname>
  </author>
  <copyright>
    <year>2008</year>
    <holder>Norman Walsh</holder>
  </copyright>
  <releaseinfo role="gmapkey">ABQIAAAAO1qAaQsvBqLxt1nDHmVdXRRUhJIzgKmGrpWaHm4UikXmtDXrMBQnr74LNwmmm8d5riiqKc0D0_dAEg</releaseinfo>
  <abstract>
    <para>An AJAX/Google Maps hack. [Update 28 Mar 2008: Now with my
Flickr contacts' photographs.]</para>
</abstract>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#Entertainment" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#SelfReference" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#TheWeb" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
</info>

<para xml:id="p1">I've suffered an almost total failure of creativity
for the past several weeks. I've been spending almost 100% of my time
working on an internal project. Technically, I'm only a half-time
resource on the project. In actual fact, I'm an “as much time as it
takes to meet deadlines” resource. The time spent thus far has been
both deeply uninteresting and intensely stressful. What little time I
carve out for other things has been spent trying to keep the
<wikipedia page="XML_pipeline">XProc</wikipedia>
specification moving fowards (slowly) and covering my commitments to other
working groups (badly).</para>

<para xml:id="p2">All of which is preamble so that you'll understand why, when I
had an actual (marginally) interesting idea, I leapt at the chance to
work on it. To my great satisfaction, it required only the space of
two or three hours last night to go from inspiration to
completion.</para>

<para xml:id="p3">My idea was this: you know how
<wikipedia>Flickr</wikipedia> (and other photography
sites) will display your pictures on a map? And you know how I have
maps in some of my essays?
Wouldn't it be cool if I could display my pictures on my own maps?
“Yes”, the answer you're looking for is “yes”, even if it's not a
particularly inspired or novel sort of mashup.</para>

<para xml:id="map" xlink:show="embed" xlink:actuate="onLoad" xlink:href="map.map" xmlns:xlink="http://www.w3.org/1999/xlink"/>

<para xml:id="p4">Extracting the locations of photographs from my Flickr backup
was easy. Generating the points on the map was easy. But having to
regenerate the maps everytime I add a new photograph was so Web 1.0.</para>

<para xml:id="p5">Instead, I coded it up as a simple little
<wikipedia page="Ajax_(programming)">AJAX</wikipedia> hack. The server
side is driven by a small “database” of geolocated photographs. That
gets updated when I backup Flickr, Flickr gets backed up everytime I
add photographs, so that's close enough to “real time” for me.</para>

<para xml:id="p6">[Update 28 Mar 2008: It occurred to me this morning that with
the heavy lifting out of the way, it'd be easy to build a database of
my Flickr contacts' photographs and stick them on the maps too.
They get blue markers instead of red ones. Nifty.]</para>

<para xml:id="p7">I spent an extra few minutes figuring out out to setup the
“drag” callback so that the displayed photographs are updated as you
drag the map around.</para>

<para xml:id="p8">The photographs returned are all those within 0.1 decimal
degrees of latitude and longitude from the center of the map (10-15
miles, roughly). What that means is, if you zoom way out and scroll
around, you don't see many new pictures. Good places to check:
Vancouver, Cromer, the Solent between Lymington and Yarmouth,
and parts of Egypt along the
Nile.</para>

</essay>

