<script type="text/javascript"
src="http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=rlerdorf">
</script>
<div id="jsmapContainer" style="height: 500px; width: 930px;"></div>
<?php
include 'simple_rss.php';
$url = 'http://earthquake.usgs.gov/eqcenter/recenteqsww/catalogs/eqs7day-M2.5.xml';
$feed = rss_request($url, $timeout=3600);
?>
<script type="text/javascript">
var marker = new Array();
var jsmap = new YMap(document.getElementById('jsmapContainer'));
jsmap.addPanControl();
jsmap.addZoomLong();
jsmap.drawZoomAndCenter("94089", 12);
<?php
$i = 0;
while(!empty($feed[$i])) {
$info = $feed[$i]['title'][0]."<br />";
$mag = str_replace('.','',substr($info,2,3));
$info .= $feed[$i]['description'][0]."<br />";
$info .= '<a href="'.$feed[$i]['link'][0].'">more info</a>';
$info = addslashes($info);
$lat = $feed[$i]['lat'][0];
$lon = $feed[$i]['long'][0];
echo <<<EOB
marker[$i] = new YMarker(new YGeoPoint($lat,$lon));
marker[$i].addLabel("$mag");
YEvent.Capture(marker[$i],
EventsList.MouseClick,
new Function("marker[$i].openSmartWindow('$info');"));
jsmap.addOverlay(marker[$i]);
EOB;
flush();
$i++;
if($i>99) break;
}
?>
</script>