I am building a website that needs several thousand maps as a "You are here" marker. It is was not practical to make a RSS file for each of these maps. So I wrote a series of 3 PHP pages that allow me to pass a URL including lat and long and it will create a html page to view the map and the corresponding RSS and config.xml files. Works well for me. This is my first attempt at writing PHP (well any program realy) so sorry if it is a bit of a mess, but I am learning.
You can also get tricky and lay these in series. I have a little map as a you are Here type map, that if you click then links to another set of these files that opens another page and allows the vistor to zoom and pan.
Have a look at http://www.wildwalks.com/maps/awxmap.php?lat=-32&long=140 for an example. Please note that this has a hardcoded zoom to center on DownUnder?
This code I is released as GPL - so do with it as you will, Hope it is helpful.
Make sure you edit you URL Note you can pass lat Long Title desc link and an easy edit will also allow you to pass width & height zoom
Any problems you can try me on matt at wildcolour dot com
File one map.php
<?php
// This code is writtern by Matt McClelland and comes with no warrenty,
// it is released under GPL licence and is intended to be used with Worldkit.
$lat = $_GET['lat'];
$long = $_GET['long'];
$title = $_GET['title'];
$desc = $_GET['desc'];
$width = "800";
$height = "400";
$zoom = "0";
// Need this little work around to make sure the there is no ulrencodeing before the second ? - not sure why
// Please edit the URL to point to you worldkit location
$url = '?confurl=http://www.yoursite.com/worldkit/mapconfig.php?' . urlencode('lat=' . $lat . '&long=' . $long . '&title=' . $title . '&desc=' . $desc . '&width=' . $width . '&height=' . $height . '&link=' . $link . '&zoom=' . $zoom);
echo '
<HTML>
<HEAD>
<TITLE>wildwalks.com maps</title>
</head>
<body style="margin: -30px;">';
?>
<left>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH="<?php echo $width; ?>" HEIGHT="<?php echo $height; ?>" id="worldkit">
<PARAM NAME=movie VALUE="worldkit.swf<?php echo $url; ?>">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#ffffff>
<EMBED src="worldkit.swf<?php echo $url; ?>" quality=high bgcolor=#000000 WIDTH="<?php echo $width; ?>" HEIGHT="<?php echo $height; ?>" NAME="worldkit" ALIGN="left" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>
</left>
</body>
</html>
File 2 mapconfig.php
<?php
$title = $_GET['title'];
$link = $_GET['link'];
$desc = $_GET['desc'];
$lat = $_GET['lat'];
$long = $_GET['long'];
$width = $_GET['width'];
$height = $_GET['height'];
$zoom = $_GET['zoom'];
// Please edit this URL to point to where you worlkit stuff us stored
$dataurl = 'http://www.yoursite.com/worldkit/maprss.php?lat=' . $lat . '&long=' . $long . '&title=' . $title . '&desc=' . $desc .'&link=' . $link;
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
//XML Header
header("content-type:text/xml");
$stuff =
'<?xml version="1.0" ?>
' .
"<worldkitconf>
" .
" <width>$width</width>
" .
" <height>$height</height>
" .
" <displaytype>day</displaytype>
" .
" <dayimg>day.jpg</dayimg>
" .
" <nightimg></nightimg>
" .
" <dataurl>$dataurl</dataurl>
" .
" <update>0</update>
" .
" <showonlynew>false</showonlynew>
" .
" <plotshape>triangle</plotshape>
" .
" <textboxsize>0</textboxsize>
".
" <initialzoom>$zoom</initialzoom>
" .
" <initiallat>$lat</initiallat>
" .
" <initiallong>$long</initiallong>
" .
" <toolbar>false</toolbar>
" .
"</worldkitconf>";
echo $stuff;
?>
File 3 maprss.php
<?php
$title = $_GET['title'];
$link = $_GET['link'];
$desc = $_GET['desc'];
$lat = $_GET['lat'];
$long = $_GET['long'];
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
//XML Header
header("content-type:text/xml");
$stuff =
'<?xml version="1.0" ?>
' .
'<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
' .
" <channel>
" .
" <title>addhoc location feed</title>
" .
" <link>http://www.yoursite.com/</link>
" .
" <description>to create Geo coded rss feed on the fly</description>
" .
" <item>
" .
" <title>$title</title>
" .
" <link>$link</link>
" .
" <description></description>
" .
" <geo:lat>$lat</geo:lat>
" .
" <geo:long>$long</geo:long>
" .
" </item>
" .
" </channel>
" .
"</rss>";
echo $stuff;
?>
