include_once '../lib/_functions.inc.php'; // app functions if (!isset($TEMPLATE)) { $TITLE = 'GPS Data'; $NAVIGATION = true; $HEAD = ' <link rel="stylesheet" href="/lib/leaflet-0.7.7/leaflet.css" /> <link rel="stylesheet" href="css/index.css" /> '; $FOOT = ' <script src="/lib/leaflet-0.7.7/leaflet.js"></script> <script>var MOUNT_PATH = "' . $MOUNT_PATH . '";</script> <script src="js/index.js"></script> '; // importJsonToArray() sets headers -> needs to run before including template $networks = importJsonToArray(__DIR__ . '/_getNetworks.json.php'); include 'template.inc.php'; } // Create HTML for network list $height = ceil($networks['count'] / 4) * 32; $networks_html = '<ul class="networks no-style" style="height: ' . $height . 'px;">'; foreach ($networks['features'] as $feature) { if ($feature['geometry']['type'] === 'Point') { // skip polygons $networks_html .= sprintf('<li> <a href="./%s/" title="Go to map of stations" class="%s">%s</a> </li>', $feature['properties']['name'], str_replace('point', 'link', $feature['id']), $feature['properties']['name']); } } $networks_html .= '</ul>'; ?>
$network = safeParam('network', 'Alaska'); if (!isset($TEMPLATE)) { $TITLE = $network . ' Network'; $NAVIGATION = true; $HEAD = ' <link rel="stylesheet" href="/lib/leaflet-0.7.7/leaflet.css" /> <link rel="stylesheet" href="' . $MOUNT_PATH . '/css/network.css" /> '; $FOOT = ' <script>var NETWORK = "' . $network . '";</script> <script>var MOUNT_PATH = "' . $MOUNT_PATH . '";</script> <script src="/lib/leaflet-0.7.7/leaflet.js"></script> <script src="' . $MOUNT_PATH . '/js/network.js"></script> '; // importJsonToArray() sets headers -> needs to run before including template $stations = importJsonToArray(__DIR__ . "/_getStations.json.php", $network); include 'template.inc.php'; } // Create HTML for station list $height = ceil($stations['count'] / 6) * 32; $starred = false; $stations_html = '<ul class="stations no-style" style="height: ' . $height . 'px;">'; foreach ($stations['features'] as $feature) { // star high rms values $star = ''; if ($feature['properties']['rms']['up'] > 15 || $feature['properties']['rms']['north'] > 10 || $feature['properties']['rms']['east'] > 10) { $star = '<span>*</span>'; $starred = true; } $stations_html .= sprintf('<li class="%s"> <a href="%s/%s/%s/" title="Go to station details">%s%s</a>