Location: PHPKode > projects > KML share > kmlshare/index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml"
  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
$layerdb = new LayerDB();
echo "<title>". APP_TITLE . "</title>";
  $key = ($_SERVER['HTTP_HOST'] == "localhost") ?
  "ABQIAAAAmM566Q2eMlQeLkr82uhCdhRoy-kUQFeUVMMsHPPuFvXFywWpiRSN3GJvcBet-vqeHjad6VgOJp6SBQ" :
  print "<script " .
    GMAP_API_KEY ."' type='text/javascript'></script>";
  <script src="prototype.js"></script>
  <script src="autosuggest.js"></script>
  <script src="renderer.js"></script>
  <link rel="stylesheet" type="text/css" href="renderer.css" />
  <link rel="stylesheet" type="text/css" href="autosuggest.css" />
<col width='250,'>
<td valign=top>
<?php echo APP_HEADING; ?>
  <div class=subtitle>
  <table><tr><td align=left>Search</td>
  <td align=right>
  <span class="help_link" topic="search">help</span>
  <form id="searchform" onsubmit="javascript: return false;">
  <input type=text id=q name=q value='' autocomplete=off>
  <input type=submit value="Search" id='button_search'>
  <div id='autosuggest'></div>
  <div class=subtitle>Browse</div>
  <p> Zoom/Pan the map to view region of Interest
  or <span class="pseudolink" id="button_poi">specify a point</span>
  function layer_row($layer) {
    $str = "";
    $lid = $layer->id;
    $color = $layer->color;
    $name = $layer->name;
    $str .= "<tr>";
    $str .= "<td><img src='" . $layer->icon ."'></td>";
    $str .= "<td>$name</td>";
    $str .= "<td><input name=checkbox_region type=checkbox value='$lid' ".
    if ($layer->status != 'locked') {
      $str .= "<td><a
      $str .= "<td><a
    $str .= "<td>";
    if ($layer->status != 'locked') {
      $str .= "<span class=add_point layerid=$lid>add</span>";
    $str .= "</td>";
    $str .= "</tr>";
    return $str;

  // Fetch all the rows
  $layers = $layerdb->getLayerArray();
  $num_layers = count($layers);
  if ($num_layers > 0) {
    print "<table border=0><col width='20,120,20,30,30'>";
    print "<tr><th colspan=6 align=left>Civic Agencies Layers</th></tr>";
    foreach ($layers as $layer) {
      if ($layer->status == "locked") {
	print layer_row($layer);
    print "<tr><th colspan=5 align=left>User Contributed Layers</th></tr>";
    foreach ($layers as $layer) {
      if ($layer->status == "live") {
	print layer_row($layer);
    print "</table>";
<input type=button value="Get Data" id='button_fetch'>
&nbsp;<input type=button value="Browse" id='button_browse'>
&nbsp;<input type=button value='Clear Map' id='button_clear'>
<div class=subtitle>Contribute</div>
<p><a href='upload.php'>Upload KML file</a>
<div id="status" style="font-weight: bold; color: white; background-color: red;">Loading maps...</div>
<div id='results'>
<div id='add_point_div'>

<td valign=top>
  <div id="map" style="width: 600px; height: 500px"></div>
<?php echo APP_FOOTER; ?>

Return current item: KML share