<html>
<head>
<?php
# $Id$
# http://www.mapbender.org/index.php/UseMap
# Copyright (C) 2002 CCGIS 
#
# This program 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, or (at your option)
# any later version.
#
# 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.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
require_once(dirname(__FILE__)."/../classes/class_gml2.php");
echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
?>
<title>image map generator</title>
</head>
<?php

$url = urldecode($_REQUEST["url"]);

$g = new gml2();
$g->parsegml($url);

echo "<script language='JavaScript'>";
echo "var um_title = new Array();";
echo "var um_x = new Array();";
echo "var um_y = new Array();";
	for($ii=0; $ii<$g->getMemberCount();$ii++){
		echo "um_title[um_title.length] = '".$g->getValueBySeparatedKey($ii,"name")."';";
		echo "um_x[um_x.length] = ".$g->getXfromMemberAsString($ii,0).";";
		echo "um_y[um_y.length] = ".$g->getYfromMemberAsString($ii,0).";";
	}
echo "</script>"
?>
<script language="JavaScript" type="text/javascript">
function init(){
	parent.mod_usemap_set(um_title,um_x,um_y)
}  
</script>  
<body onload='init()'>
</body>
</html>