$result = get_point($id); } /* 角色 管理者: 回傳所有點, 可編輯所有點 使用者: 回傳公用點,個人點, 編輯個人點 */ list($st, $info) = userid(); if ($id !== 'ALL') { if ($st === true) { $result[0]['info'] = $info; } // 補上高度資料 if ($result[0]['ele'] == 0) { $twDEM_path = "../db/DEM/twdtm_asterV2_30m.tif"; $ele = get_elev($twDEM_path, $result[0]['y'], $result[0]['x'], 1); if ($ele > -1000) { $result[0]['ele'] = $ele; } else { unset($result[0]['ele']); } } $result[0]['story'] = tell_story($result[0]); } else { } // 載入哪些點? foreach ($result as $row) { unset($row['coord']); // 已登入 if ($st === true) { if (is_admin()) {
<?php require_once "../config.inc.php"; $twDEM_path = "../db/DEM/twdtm_asterV2_30m.tif"; $loc = $_REQUEST['loc']; if (empty($loc)) { ajaxerr("insufficent parameters"); } list($lat, $lon) = explode(",", $_REQUEST['loc']); $ele = get_elev($twDEM_path, $lat, $lon, 1); $data['elevation'] = $ele; ajaxok($data);
ajaxerr("too big range"); } if ($r == 0) { ajaxerr("empty"); } $data = get_waypoint($x, $y, $r, $detail); $trk_data = get_track($x, $y, $r, $detail); // 整理一下 data if ($data === false || count($data) == 0 && count($trk_data) == 0) { header('Access-Control-Allow-Origin: *'); ajaxerr("empty result"); } if (empty($detail) || $detail == 0) { // 傳回高度 $twDEM_path = "../db/DEM/twdtm_asterV2_30m.tif"; $ele = get_elev($twDEM_path, $y, $x, 1); header('Access-Control-Allow-Origin: *'); ajaxok(array("wpt" => $data, "trk" => $trk_data, "ele" => $ele)); } else { // web page echo "<html>"; echo "<head><title>TWMAP waypoint detail</title><meta charset=\"UTF-8\">"; echo "<script src='https://code.jquery.com/jquery-2.1.4.min.js'></script>"; echo "<style>\n\t<script src='https://code.jquery.com/jquery-2.1.4.min.js'></script>\n\t/* Document level adjustments */\nhtml {\n font-size: 17px;\n}\n@media (max-width: 900px) {\n html,table { font-size: 15px; }\n}\n@media (max-width: 400px) {\n html,table { font-size: 13px; }\n}\n\ntable, td, th {\n border: 1px solid green;\n}\n\nth {\n background-color: green;\n color: white;\n}\n\n</style></head>"; echo "<body><div id='wpt_info' align=center>"; echo "<hr>以下 GPS 航跡皆為山友無私貢獻分享,請大家上山前做好準備,快樂出門,平安回家!"; echo "<br>距座標點" . $_REQUEST['r'] . "M 的範圍的航點資訊"; echo "<table>"; echo "<tr><th width=30%>名稱<th>高度(M)<th>顯示<th>下載<th>地圖"; $ans = array(); foreach ($data as $row) {