-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgpsmap.php
79 lines (70 loc) · 3.5 KB
/
gpsmap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2009-2013 Andrew Aloia |
| Copyright (C) 2014 Wixiweb |
| |
| 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 |
| of the License, 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. |
+-------------------------------------------------------------------------+
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/
chdir('../../');
include_once('./include/auth.php');
include_once('./include/top_graph_header.php');
include_once('./plugins/gpsmap/includes/setup/show.php');
include_once('./plugins/gpsmap/includes/setup/gpsmapinitial.php');
$body = '';
//decide what needs to be shown
switch ($show) {
//selected nodes
case 'setup':
$body = 'Please make sure to properly configure GPS Map first under settings -> gpsmap';
break;
default:
if (!$parameter) {
$parameter = 'all';
}
$fileLocation = './plugins/gpsmap/XML/' . $parameter . '-top.html';
$mapTop = file_get_contents($fileLocation);
echo($mapTop);
break;
}
//---------------------------------------------------------------
if ($show != 'setup') {?>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?<?php echo (empty($apiKey) === false) ? 'key=' . $apiKey . '&' : ''; ?>sensor=false&libraries=geometry"></script>
<script type="text/javascript" src="./js/GPSMaps.js"></script>
<script type="text/javascript" src="./js/infobubble.js"></script>
<script type="text/javascript">
gpsmap.refreshMap = '<?php echo $refreshMap; ?>';
gpsmap.initialLat = <?php echo $initialLat; ?>;
gpsmap.initialLng = <?php echo $initialLong; ?>;
gpsmap.initialZoom = <?php echo$initialzoom; ?>;
gpsmap.liColor = '<?php echo $liColor; ?>';
gpsmap.liWidth = '<?php echo $liWidth; ?>';
gpsmap.liOpa = '<?php echo $liOpa; ?>';
gpsmap.fillColor = '<?php echo $fillColor; ?>';
gpsmap.fillOpa = '<?php echo $fillOpa; ?>';
gpsmap.circleQuality = '<?php echo $circleQuality; ?>';
gpsmap.enableWeather = '<?php echo $enableWeather; ?>';
gpsmap.coverageOverlay = '<?php echo $coverageMap; ?>';
gpsmap.downloadURL = '<?php echo './XML/', $parameter, '.xml'; ?>';
gpsmap.t_error = parseFloat('<?php echo $terror; ?>');
<?php include_once('plugins/gpsmap/includes/icons.php'); ?>
<?php include_once('plugins/gpsmap/includes/customicons.php'); ?>
google.maps.event.addDomListener(window, 'load', function() {gpsmap.loader();});
window.onresize = gpsmap.resize;
</script>
</head>
<?php
}
$body .= '</script><div id="map" style="height:10px;"></div>';
echo $body;