how to pflog
Do Not Eat Package
Adding
pflog to your web site takes three steps:
- Upload
pflog.swf to your web site.
- Upload an XML document that defines the locations to plot.
- In your web page's HTML, paste example code (shown below) to load pflog.
HTML Code
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase=
"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
width="500" height="266" id="pflog" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="http://www.yourwebsite.com/path/to/pflog.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="xmlurl=/path/to/yourmap.xml"
/>
<embed src="http://www.yourwebsite.com/path/to/pflog.swf" quality="high" bgcolor="#ffffff"
FlashVars="xmlurl=/path/to/yourmap.xml"
width="500" height="266" name="pflog" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"
/>
</object>
Be sure to edit the HTML code you paste to point to
your copy of pflog and
your XML locations document, as shown in the red highlighted areas above.
XML Document
The basic structure of a pflog
<map> document might look something like this:
<?xml version="1.0" encoding="UTF-8"?>
<map>
<settings>
[...]
</settings>
<routes>
<route>
<name>Eurasia</name>
<latitude>42N</latitude>
<longitude>10E</longitude>
<zoom>5</zoom>
<locations>
<location>
<name>London, England</name>
<arrivaldate>1872-10-2</arrivaldate>
<latitude>51.500N</latitude>
<longitude>0.116W</longitude>
<note>Fogg accepts a wager for 20,000 pounds.</note>
<url>http://en.wikipedia.org/wiki/London</url>
</location>
[...]
</locations>
</route>
[...]
</routes>
</map>
A
<map> document contains
<settings> that
tell pflog how to format its display, and
<routes> for pflog
to draw. Each
<route> in
<routes> has coordinates
and a
<zoom> magnification that tell pflog how to zoom in to portray
that route. Finally, a
<route> has
<locations>
that pflog charts out on the map. Each
<location> has a series
of tags that pflog uses to label the point, and place it according to
<latitude> and
<longitude> coordinates.
Multimap is a nice resource for finding
latitude/longitude coordinates for locations all over the world.
The best way to make your XML document is to take one of the included example XML
documents and use it as a template to build your own. For a basic structure that you
can copy/paste, check out
simple.xml. For a full list of functionality,
be sure to browse through the included
80days.xml, which in fact contains
every XML tag that pflog is capable of recognizing, and an explanation of each.
It's worth noting that every tag that can specify a display setting in
<settings> can be omitted and placed instead in the HTML object/embed
code. This is particularly useful for those markup purists hung up on separating style
from substance. Browse the source of
80days.htm to see how this is done.
AND THAT'S IT!
Really, I could have included drawn out schema definitions - maybe even a DTD - but
why make it any more complicated than it has to be?