<html>
<head>
<title>Browse Maps 1</title>
<script language="javascript">
var areas = new Array();
function areaObject(name, id) {
this.name = name;
this.id = id;
}
function showText(text) {
status = text;
}
function clearAreas() {
for(key in areas) {
areas[key] = null;
}
// update the selected areas div
var element = document.getElementById('selected_areas');
element.innerHTML = '';
// update the map
// document.map.src = //"http://[host]/cgi-bin/mapserv48?layer=[qlayer]&map=[map]&mode=map&mapext//=[mapext_esc]&mapsize=[mapwidth]+[mapheight]";
}
function selectArea(name, id) {
if(areas[name] && areas[name] != null) { // unset
areas[name] = null;
} else {
areas[name] = new areaObject(name, id);
}
// compute a few things passing through the areas array
var ids = new Array();
var content = '';
for(key in areas) {
if(areas[key] != null) {
content += areas[key].name + " (" + areas[key].id + ")<br>";
ids.push(areas[key].id);
}
}
// update the selected areas div
var element = document.getElementById('selected_areas');
element.innerHTML = content;
// update the map
document.map.src = "http://[host]/cgi-bin/mapserv?layer=[layer]&layer=[qlayer]&map=[map]&mode=map&mapext=[mapext_esc]&mapsize=[mapwidth]+[mapheight]&ids=" + ids.join(',');
}
</script>
</head>
<body>
<map id="mymap_id" name="points">