source: trunk/src/map/index.php@ 7723

Last change on this file since 7723 was 7723, checked in by rick, 15 years ago

Hacked Google key support for multiple domains

File size: 4.1 KB
RevLine 
[7722]1<?php require_once("inc/kmlHandler.php"); ?>
[7723]2<?php include("../config.php");
[7722]3
[7723]4# Key is defined to be the domain name if exists
5$apikey = $config['googlekey']['default'];
6$servername = $_SERVER['SERVER_NAME'];
7
8# Little hack, does not work with foo.co.uk domains
9$servername = implode('.',array_slice(explode('.',$servername),-2));
10if (array_key_exists($servername,$config['googlekey'])) {
11 $apikey = $config['googlekey'][$servername];
12}
13?>
14
[7664]15<html>
16<head>
17<title>Nodemap Wireless Leiden</title>
[7717]18<!-- External stylesheet for all browsers -->
[7664]19<link href="style/stylesheet.css" rel="stylesheet" type="text/css">
[7717]20<!-- Using stylesheet2.css when browser is any version of Microsoft Internet Explorer -->
[7688]21<!--[if IE]>
22 <link href="style/stylesheet2.css" rel="stylesheet" type="text/css">
23<![endif]-->
24
[7722]25<!-- Make our $marker[] array from kmlHandler available to javascript in JSON-->
26<script>
27var markers = <?php echo json_encode($markers); ?>;
28</script>
29
[7665]30<!-- Loading in the google-api -->
[7723]31<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?=$apikey;?>" type="text/javascript"></script>
[7665]32<!-- Loading in the javascript that will add the map into #mapcanvas -->
33<script type="text/javascript" src="inc/nodemapWL.js"></script>
[7709]34<script type="text/javascript" src="inc/overlay.js"></script>
[7719]35
36<!-- Loading in the javascript that handles the switching between gebruiker and beheerder -->
[7718]37<script type="text/javascript" src="inc/gebruiker_beheerder_switch.js"></script>
[7664]38</head>
39<body>
[7717]40<!-- Mainwrapper contains all content on the page -->
[7664]41<div id="mainwrapper">
[7717]42 <!-- Mapcanvas is the container where the map will be put in. Height and width of map is specified by size of the div -->
[7665]43 <div id="mapcanvas">
44 <!-- Create the map using the intitialize_map() function from nodemapWL.js -->
45 <script type="text/javascript">initialize_map();</script>
[7709]46 <!--<script type="text/javascript">nodeAdd();</script>-->
[7665]47 </div>
[7664]48 <div id="infowrapper">
[7675]49 <!-- Top information space -->
50 <div id="infotop">
[7717]51 <!-- Calling on the node information from an external php file. inc/node_info.php -->
[7716]52 <?php include("inc/node_info.php") ?>
[7675]53 </div>
54
55 <!-- Bottom information space -->
56 <div id="infobottom">
[7717]57 <!-- This contains the searchbox of the searchtool, and the send button for it -->
[7676]58 <div id="searchbox">
[7687]59 <form>
[7715]60 <input type="text" name="naam" size="18" maxlength="30"><input type="button" name="knop" value=" > ">
[7687]61 </form>
[7676]62 </div>
[7717]63 <!-- This contains the list of nodes, in future the searchbox will make it possible to filter this list -->
[7676]64 <div id="searchlist">
[7687]65 <select multiple>
66 <option value="node1">Node 1 Leiden</option>
67 <option value="node2">Node 2 Leiden</option>
68 <option value="node3">Node 3 Leiden</option>
69 <option value="node4">Node 4 Leiden</option>
70 <option value="node5">Node 5 Leiden</option>
71 <option value="node6">Node 6 Leiden</option>
72 <option value="node7">Node 7 Leiden</option>
73 <option value="node8">Node 8 Leiden</option>
74 <option value="node9">Node 9 Leiden</option>
75 <option value="node10">Node 10 Leiden</option>
76 </select>
[7676]77 </div>
[7675]78 </div>
[7716]79 <!-- The buttons under the searchframe. In a table for positioning. -->
[7715]80 <div id="userpick">
81 <table>
[7719]82 <tr><!-- onclick events activate functions from within inc/gebruiker_beheerder_switch.js which load in the selected view with node_info.php -->
[7718]83 <td><input type="button" value="Gebruiker" onclick="switchGebruiker();"></td>
84 <td><input type="button" value="Beheerder" onclick="switchBeheerder();"></td>
[7715]85 </tr>
86 </table>
87 </div>
[7664]88 </div>
[7695]89
[7673]90 <!-- General functions under the map -->
91 <div id="navigation">
92 <form>
93 <table>
94 <tr>
95 <!-- First colum -->
96 <td>
[7715]97 <input type="checkbox" value="shownodes" onclick="toggleMyKml();" checked="checked">Toon nodes
[7673]98 </td>
99 <!-- Second colum -->
100 <td>
101 <input type="checkbox" value="showrange">Toon dekking <br/>
102 <input type="checkbox" value="showtraffic">Toon dataverkeer
103 </td>
104 </tr>
105 </table>
106 </form>
107 </div>
[7664]108</div>
109</body>
[7723]110</html>
Note: See TracBrowser for help on using the repository browser.