<?
/******************************************************************************
# Copyright notice
#
# This file is part of Wiki-Map project [http://wiki-map.sourceforge.net/]
# Wiki-Map is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# The GNU General Public License can be found at
# http://www.gnu.org/copyleft/gpl.html.
# A copy is found in the textfile GPL and important notices to the
# license from the team is found in the textfile LICENSE distributed
# with these scripts.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# This copyright notice MUST APPEAR in all copies and derivatives of the script!
#*********************************************************************************
# $Source: /cvsroot/wiki-map/maps/index.php,v $
# $Header: /cvsroot/wiki-map/maps/index.php,v 1.1.1.1 2007/01/24 17:50:33 soumya42 Exp $
# ------------------- Your program should come below this --------------------------- -->
*/
$id = $_GET[id];
$key = $_GET[key];
$sa = array("sp"=>300, "mp"=>480, "sl"=>240, "ml"=>480);
$sb = array("sp"=>240, "mp"=>352, "sl"=>300, "ml"=>600);
include "openDB.php";
$sql = "SELECT * FROM shtags WHERE id='$id'";
$result = mysql_query($sql);
if (!$result){
echo '** Query falied ** '.mysql_error().'<BR>\n';
} else {
$m = mysql_fetch_assoc($result);
$y = $m[long];
$x = $m[lat];
$d = stripslashes($m[Description]);
$z = $m[z];
$km = $m[s].$m[l];
$ht = $sa[$km];
$wd = $sb[$km];
$k = $m[key];
}
echo "<!-- $km $ht $wd \n";
print_r($sa);
print_r($m);
echo "-->";
?>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAApL1hGE-KNQcfWmK-4HpMHRSAsL_rpfnb7R6YjdHmXm9ZuwilPhTw9DUGZeCNDTsWftNOHtjvtQkLCQ"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
//------------------------------Show Map ----------------------------------
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(<?=$x ?>,<?=$y ?> ), <?=$z?>);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setMapType(G_HYBRID_MAP);
map.addControl(new GScaleControl());
map.openInfoWindow(map.getCenter(),
document.createTextNode("<?=$d?>"));
}
}
//------------------------- End load ----------------------------------------
//]]>
</script>
</head>
<!-- This is a template to show the map -->
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: <?=$wd?>px; height: <?=$ht?>px"></div>
</body>