|
|
@@ -0,0 +1,537 @@
|
|
|
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
|
+<html>
|
|
|
+
|
|
|
+<head>
|
|
|
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
+ <link type="text/css" rel="stylesheet" href="../pcdl/css/font.css" />
|
|
|
+ <link type="text/css" rel="stylesheet" href="../pcdl/css/basic_style.css" />
|
|
|
+ <link type="text/css" rel="stylesheet" href="../pcdl/css/style.css" />
|
|
|
+ <link type="text/css" rel="stylesheet" href="../pcdl/css/color_day.css" id="colorchange" />
|
|
|
+ <link type="text/css" rel="stylesheet" href="../pcdl/css/style_mobile.css" media="screen and (max-width:767px)">
|
|
|
+
|
|
|
+ <script src="../public/js/jquery.js"></script>
|
|
|
+ <script src="../public/js/comm.js"></script>
|
|
|
+ <script src="jquery-3.3.1.min.js"></script>
|
|
|
+ <script src="suncalc.js"></script>
|
|
|
+ <script src="../studio/js/fixedsticky.js"></script>
|
|
|
+ <script src="../guide/guide.js"></script>
|
|
|
+ <link type="text/css" rel="stylesheet" href="../guide/guide.css" />
|
|
|
+
|
|
|
+ <script src="../public/js/marked.js"></script>
|
|
|
+ <!--获取语言-->
|
|
|
+ <script>
|
|
|
+ var g_language = "en";
|
|
|
+ var g_currLink = "";
|
|
|
+ function lang_init(strPage) {
|
|
|
+ g_currLink = strPage;
|
|
|
+ }
|
|
|
+ function setLang(strLang) {
|
|
|
+ g_language = strLang;
|
|
|
+ setCookie('language', g_language, 365);
|
|
|
+ window.location.assign(location.pathname + "?language=" + g_language);
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+ <script>
|
|
|
+ var localString = new Array();
|
|
|
+ localString["zh-cn"] = {
|
|
|
+ "and_another": "又 ",
|
|
|
+ "atitude": "纬度",
|
|
|
+ "BE": "佛历",
|
|
|
+ "bhumma": "周二",
|
|
|
+ "budha": "周三",
|
|
|
+ "canda": "周一",
|
|
|
+ "confirm": "确认",
|
|
|
+ "date": "日期",
|
|
|
+ "day": "日",
|
|
|
+ "days": "天 ",
|
|
|
+ "departure_in_detail": "起飞详情",
|
|
|
+ "dhamma_time": "会延续五千年的教法 ",
|
|
|
+ "eat": "进餐",
|
|
|
+ "gama_entry": "入村",
|
|
|
+ "guru": "周四",
|
|
|
+ "hori_ref_time": "蒙气差修正 ",
|
|
|
+ "kala": "适当的时间",
|
|
|
+ "language_select": "选择语言",
|
|
|
+ "left": "还剩下",
|
|
|
+ "loading": "载入中……",
|
|
|
+ "longitude": "经度",
|
|
|
+ "māsa": "月",
|
|
|
+ "mins": "分钟",
|
|
|
+ "month": "月 ",
|
|
|
+ "month_1": "月 ",
|
|
|
+ "months": "个月 ",
|
|
|
+ "my_loc": "我的位置",
|
|
|
+ "need_inform": "未告知其他比库",
|
|
|
+ "no_string": "不能",
|
|
|
+ "noon_time": "正午",
|
|
|
+ "noon_time": "正午",
|
|
|
+ "note": "注释",
|
|
|
+ "now_time": "现在",
|
|
|
+ "pacchā_māsa": "下个月",
|
|
|
+ "pakkha": "月相变化 ",
|
|
|
+ "past": "已过去",
|
|
|
+ "pubba_māsa": "上个月",
|
|
|
+ "ravi": "周日",
|
|
|
+ "saṃvacchara": "年",
|
|
|
+ "season": "季节 ",
|
|
|
+ "sec": "秒",
|
|
|
+ "sora": "周六",
|
|
|
+ "sukka": "周五",
|
|
|
+ "sun_height_degree": "正午太阳高度 ",
|
|
|
+ "time": "时间",
|
|
|
+ "twilight_time": "曙光",
|
|
|
+ "twilight_time": "曙光",
|
|
|
+ "vikala": "不适当的时间",
|
|
|
+ "week_day": "星期",
|
|
|
+ "year_0": "年",
|
|
|
+ "year_1": "年 ",
|
|
|
+ "years": "年 ",
|
|
|
+ "yes_string": "可以"
|
|
|
+ };
|
|
|
+ localString["zh-tw"] = {
|
|
|
+ "and_another": "又 ",
|
|
|
+ "atitude": "緯度",
|
|
|
+ "BE": "佛曆",
|
|
|
+ "bhumma": "週二",
|
|
|
+ "budha": "週三",
|
|
|
+ "canda": "週一",
|
|
|
+ "confirm": "確認",
|
|
|
+ "date": "日期",
|
|
|
+ "day": "日",
|
|
|
+ "days": "天 ",
|
|
|
+ "departure_in_detail": "起飛詳情",
|
|
|
+ "dhamma_time": "會延續五千年的教法 ",
|
|
|
+ "eat": "進餐",
|
|
|
+ "gama_entry": "入村",
|
|
|
+ "guru": "週四",
|
|
|
+ "hori_ref_time": "蒙氣差修正 ",
|
|
|
+ "kala": "適當的時間",
|
|
|
+ "language_select": "選擇語言",
|
|
|
+ "left": "還剩下",
|
|
|
+ "loading": "載入中……",
|
|
|
+ "longitude": "經度",
|
|
|
+ "māsa": "月",
|
|
|
+ "mins": "分鐘",
|
|
|
+ "month": "月 ",
|
|
|
+ "month_1": "月 ",
|
|
|
+ "months": "個月 ",
|
|
|
+ "my_loc": "我的位置",
|
|
|
+ "need_inform": "未告知其他比庫",
|
|
|
+ "no_string": "不能",
|
|
|
+ "noon_time": "正午",
|
|
|
+ "noon_time": "正午",
|
|
|
+ "note": "註釋",
|
|
|
+ "now_time": "現在",
|
|
|
+ "pacchā_māsa": "下個月",
|
|
|
+ "pakkha": "月相變化 ",
|
|
|
+ "past": "已過去",
|
|
|
+ "pubba_māsa": "上個月",
|
|
|
+ "ravi": "週日",
|
|
|
+ "saṃvacchara": "年",
|
|
|
+ "season": "季節 ",
|
|
|
+ "sec": "秒",
|
|
|
+ "sora": "週六",
|
|
|
+ "sukka": "週五",
|
|
|
+ "sun_height_degree": "正午太陽高度 ",
|
|
|
+ "time": "時間",
|
|
|
+ "twilight_time": "曙光",
|
|
|
+ "twilight_time": "曙光",
|
|
|
+ "vikala": "不適當的時間",
|
|
|
+ "week_day": "星期",
|
|
|
+ "year_0": "年",
|
|
|
+ "year_1": "年 ",
|
|
|
+ "years": "年 ",
|
|
|
+ "yes_string": "可以"
|
|
|
+ };
|
|
|
+ localString["default"] = {
|
|
|
+ "and_another": " and ",
|
|
|
+ "atitude": "Atitude",
|
|
|
+ "BE": "Buddhist Era ",
|
|
|
+ "bhumma": "Bhumma",
|
|
|
+ "budha": "Budha",
|
|
|
+ "canda": "Canda",
|
|
|
+ "confirm": "Confirm",
|
|
|
+ "date": "Date ",
|
|
|
+ "day": " day(s) ",
|
|
|
+ "days": " day(s) ",
|
|
|
+ "departure_in_detail": "departure in detail",
|
|
|
+ "dhamma_time": "5000 Years of the Buddha’s Dispensation ",
|
|
|
+ "eat": "eat",
|
|
|
+ "gama_entry": "entry the village",
|
|
|
+ "guru": "Guru",
|
|
|
+ "hori_ref_time": "horizontal refraction correct ",
|
|
|
+ "kala": "suitable time",
|
|
|
+ "language_select": "bhāsā",
|
|
|
+ "left": "Remains ",
|
|
|
+ "loading": "loading…",
|
|
|
+ "longitude": "Longitude",
|
|
|
+ "māsa": "māsa",
|
|
|
+ "mins": "(min)",
|
|
|
+ "month": "Month ",
|
|
|
+ "month_1": "- ",
|
|
|
+ "months": " month(s) ",
|
|
|
+ "my_loc": "attasmiṃ",
|
|
|
+ "need_inform": "without informing other Bhikkhu ",
|
|
|
+ "no_string": "cannot ",
|
|
|
+ "noon_time": "NOON",
|
|
|
+ "noon_time": "NOON",
|
|
|
+ "note": "Note",
|
|
|
+ "now_time": "NOW",
|
|
|
+ "pacchā_māsa": "pacchā-māsa",
|
|
|
+ "pakkha": "Lunar Phases ",
|
|
|
+ "past": "Passed ",
|
|
|
+ "pubba_māsa": "pubba-māsa",
|
|
|
+ "ravi": "Ravi",
|
|
|
+ "saṃvacchara": "saṃvacchara",
|
|
|
+ "season": "Season ",
|
|
|
+ "sec": "sec ",
|
|
|
+ "sora": "Sora",
|
|
|
+ "sukka": "Sukka",
|
|
|
+ "sun_height_degree": "Max solar altitude ",
|
|
|
+ "time": "Time",
|
|
|
+ "twilight_time": "dawn",
|
|
|
+ "twilight_time": "dawn",
|
|
|
+ "vikala": "unsuitable time",
|
|
|
+ "week_day": "Day",
|
|
|
+ "year_0": "saṃvacchara",
|
|
|
+ "year_1": "- ",
|
|
|
+ "years": " year(s) ",
|
|
|
+ "yes_string": "can "
|
|
|
+ };
|
|
|
+ localString["en"] = {
|
|
|
+ "and_another": " and ",
|
|
|
+ "atitude": "Atitude",
|
|
|
+ "BE": "Buddhist Era ",
|
|
|
+ "bhumma": "Bhumma",
|
|
|
+ "budha": "Budha",
|
|
|
+ "canda": "Canda",
|
|
|
+ "confirm": "Confirm",
|
|
|
+ "date": "Date",
|
|
|
+ "day": " day(s) ",
|
|
|
+ "days": " day(s) ",
|
|
|
+ "departure_in_detail": "departure in detail",
|
|
|
+ "dhamma_time": "5000 Years of the Buddha’s Dispensation ",
|
|
|
+ "eat": "eat",
|
|
|
+ "gama_entry": "entry the village",
|
|
|
+ "guru": "Guru",
|
|
|
+ "hori_ref_time": "horizontal refraction correct ",
|
|
|
+ "kala": "suitable time",
|
|
|
+ "language_select": "Language",
|
|
|
+ "left": "Remains ",
|
|
|
+ "loading": "loading…",
|
|
|
+ "longitude": "Longitude",
|
|
|
+ "māsa": "māsa",
|
|
|
+ "mins": "(min)",
|
|
|
+ "month": "Month ",
|
|
|
+ "month_1": "- ",
|
|
|
+ "months": " month(s) ",
|
|
|
+ "my_loc": "my location",
|
|
|
+ "need_inform": "without informing other Bhikkhu ",
|
|
|
+ "no_string": "cannot ",
|
|
|
+ "noon_time": "NOON",
|
|
|
+ "noon_time": "NOON",
|
|
|
+ "note": "Note",
|
|
|
+ "now_time": "NOW",
|
|
|
+ "pacchā_māsa": "pacchā-māsa",
|
|
|
+ "pakkha": "Lunar Phases ",
|
|
|
+ "past": "Passed ",
|
|
|
+ "pubba_māsa": "pubba-māsa",
|
|
|
+ "ravi": "Ravi",
|
|
|
+ "saṃvacchara": "saṃvacchara",
|
|
|
+ "season": "Season ",
|
|
|
+ "sec": "sec",
|
|
|
+ "sora": "Sora",
|
|
|
+ "sukka": "Sukka",
|
|
|
+ "sun_height_degree": "Max solar altitude ",
|
|
|
+ "time": "time",
|
|
|
+ "twilight_time": "dawn",
|
|
|
+ "twilight_time": "dawn",
|
|
|
+ "vikala": "unsuitable time",
|
|
|
+ "week_day": "Day",
|
|
|
+ "year_0": "year",
|
|
|
+ "year_1": "- ",
|
|
|
+ "years": " year(s) ",
|
|
|
+ "yes_string": "can "
|
|
|
+ };
|
|
|
+ localString["my"] = {
|
|
|
+ "and_another": " and ",
|
|
|
+ "atitude": "Atitude",
|
|
|
+ "BE": "Buddhist Era ",
|
|
|
+ "bhumma": "ဘုမ္မ",
|
|
|
+ "budha": "ဗုဓ",
|
|
|
+ "canda": "စန္ဒ",
|
|
|
+ "confirm": "Confirm",
|
|
|
+ "date": "Date ",
|
|
|
+ "day": " day(s) ",
|
|
|
+ "days": " day(s) ",
|
|
|
+ "departure_in_detail": "departure in detail",
|
|
|
+ "dhamma_time": "5000 Years of the Buddha’s Dispensation ",
|
|
|
+ "eat": "eat",
|
|
|
+ "gama_entry": "entry the village",
|
|
|
+ "guru": "ဂုရု",
|
|
|
+ "hori_ref_time": "horizontal refraction correct ",
|
|
|
+ "kala": "ကာလ",
|
|
|
+ "language_select": "ဘာသာ",
|
|
|
+ "left": "Remains ",
|
|
|
+ "loading": "loading…",
|
|
|
+ "longitude": "Longitude",
|
|
|
+ "māsa": "မာသ",
|
|
|
+ "mins": "(min)",
|
|
|
+ "month": "Month ",
|
|
|
+ "month_1": "- ",
|
|
|
+ "months": " month(s) ",
|
|
|
+ "my_loc": "အတ္တသ္မိံ",
|
|
|
+ "need_inform": "without informing other Bhikkhu ",
|
|
|
+ "no_string": "cannot ",
|
|
|
+ "noon_time": "မဇ္ဈန္ဟိက",
|
|
|
+ "noon_time": "မဇ္ဈန္ဟိက",
|
|
|
+ "note": "Note",
|
|
|
+ "now_time": "ပစ္စုပ္ပန္န",
|
|
|
+ "pacchā_māsa": "ပစ္ဆာ-မာသ",
|
|
|
+ "pakkha": "Lunar Phases ",
|
|
|
+ "past": "Passed ",
|
|
|
+ "pubba_māsa": "ပုဗ္ဗ-မာသ",
|
|
|
+ "ravi": "ရဝိ",
|
|
|
+ "saṃvacchara": "သံဝစ္ဆရ",
|
|
|
+ "season": "Season ",
|
|
|
+ "sec": "sec ",
|
|
|
+ "sora": "သောရ",
|
|
|
+ "sukka": "သုက္က",
|
|
|
+ "sun_height_degree": "Max solar altitude ",
|
|
|
+ "time": "Time",
|
|
|
+ "twilight_time": "အရုဏုဂ္ဂမန",
|
|
|
+ "twilight_time": "အရုဏုဂ္ဂမန",
|
|
|
+ "vikala": "ဝိကာလ",
|
|
|
+ "week_day": "Day",
|
|
|
+ "year_0": "year",
|
|
|
+ "year_1": "- ",
|
|
|
+ "years": " year(s) ",
|
|
|
+ "yes_string": "can "
|
|
|
+ };
|
|
|
+ localString["si"] = {
|
|
|
+ "and_another": " ච ",
|
|
|
+ "atitude": "Atitude",
|
|
|
+ "BE": "බුද්ධ වර්ෂය ",
|
|
|
+ "bhumma": "භුම්ම",
|
|
|
+ "budha": "බුධ",
|
|
|
+ "canda": "චන්ද",
|
|
|
+ "confirm": "Confirm",
|
|
|
+ "date": "දිවස ",
|
|
|
+ "day": " දිවසා(නි) ",
|
|
|
+ "days": " දිවසා(නි) ",
|
|
|
+ "departure_in_detail": "departure in detail",
|
|
|
+ "dhamma_time": "සම්මා සම්බුද්ධස්ස සාසනං පට්ච-වස්ස-සහස්සානි පවත්තිස්සති ",
|
|
|
+ "eat": "eat",
|
|
|
+ "gama_entry": "entry the village",
|
|
|
+ "guru": "ගුරු",
|
|
|
+ "hori_ref_time": "horizontal refraction correct ",
|
|
|
+ "kala": "කාල",
|
|
|
+ "language_select": "භාෂාව",
|
|
|
+ "left": "අවසිට්ඨ ",
|
|
|
+ "loading": "ප්රවේශනය වෙනවා ",
|
|
|
+ "longitude": "Longitude",
|
|
|
+ "māsa": "මාස",
|
|
|
+ "mins": "(min)",
|
|
|
+ "month": "මාස ",
|
|
|
+ "month_1": "- ",
|
|
|
+ "months": " මාසා(නි) ",
|
|
|
+ "my_loc": "අත්තස්මිං",
|
|
|
+ "need_inform": "without informing other Bhikkhu ",
|
|
|
+ "no_string": "cannot ",
|
|
|
+ "noon_time": "මජ්ඣන්හික",
|
|
|
+ "noon_time": "මජ්ඣන්හික",
|
|
|
+ "note": "නෝට්ටුව ",
|
|
|
+ "now_time": "පච්චුප්පන්න",
|
|
|
+ "pacchā_māsa": "පච්ඡා-මාස",
|
|
|
+ "pakkha": "පක්ඛ ",
|
|
|
+ "past": "අතික්කන්ත ",
|
|
|
+ "pubba_māsa": "පුබ්බ-මාස",
|
|
|
+ "ravi": "රවි",
|
|
|
+ "saṃvacchara": "සංවච්ඡර",
|
|
|
+ "season": "උතු ",
|
|
|
+ "sec": "sec",
|
|
|
+ "sora": "සොර",
|
|
|
+ "sukka": "සුක්ක",
|
|
|
+ "sun_height_degree": "Max solar altitude ",
|
|
|
+ "time": "time",
|
|
|
+ "twilight_time": "අරුණුග්ගමන",
|
|
|
+ "twilight_time": "අරුණුග්ගමන",
|
|
|
+ "vikala": "විකාල",
|
|
|
+ "week_day": "වාර ",
|
|
|
+ "year_0": "සංවච්ඡර",
|
|
|
+ "year_1": "- ",
|
|
|
+ "years": " සංවච්ඡරා(නි) ",
|
|
|
+ "yes_string": "can "
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ </script>
|
|
|
+ <style>
|
|
|
+ .card {
|
|
|
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
|
|
|
+ font-size: 1em;
|
|
|
+ line-height: 1.3;
|
|
|
+ }
|
|
|
+
|
|
|
+ .card>.title>a,
|
|
|
+ .card>.title>a:link {
|
|
|
+ color: var(--main-color);
|
|
|
+ }
|
|
|
+
|
|
|
+ .card a:hover {
|
|
|
+ color: var(--tool-link-hover-color);
|
|
|
+ }
|
|
|
+
|
|
|
+ .index_inner {
|
|
|
+ width: 960px;
|
|
|
+ margin-left: auto;
|
|
|
+ margin-right: auto;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ <title id='title_text'>
|
|
|
+ </title>
|
|
|
+</head>
|
|
|
+
|
|
|
+<body>
|
|
|
+ <!--多语言范例
|
|
|
+ <script>
|
|
|
+ document.write(localString["language"].XXXX);
|
|
|
+ </script>
|
|
|
+
|
|
|
+ -->
|
|
|
+ <div id='position_change'>
|
|
|
+ <span id='selected_position_string'>
|
|
|
+ <script>
|
|
|
+ document.write(localString[g_language].loading);
|
|
|
+ //localString[g_language].loading;
|
|
|
+ </script>
|
|
|
+ </span>
|
|
|
+ <!--自动定位-->
|
|
|
+ <button onclick='getLocation()' style='font-size: 100%; padding: 2px 6px;'>
|
|
|
+ <svg class='icon' style='min-width: 1.8em; min-height: 1.8em;'>
|
|
|
+ <path
|
|
|
+ d='M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z' />
|
|
|
+ </svg>
|
|
|
+ <script>
|
|
|
+ document.write(localString[g_language].my_loc);
|
|
|
+ //localString[g_language].my_loc
|
|
|
+ </script>
|
|
|
+ </button>
|
|
|
+ <input id="input_time" type="datetime-local">
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div onclick="show_time()">Sun time table</div>
|
|
|
+ <div><span id="today_dawn"></span></div>
|
|
|
+ <div><span id="today_solarNoon"></span></div>
|
|
|
+ <div><span id="today_sunset"></span></div>
|
|
|
+ <div><span id="today_moon_phase"></span></div>
|
|
|
+ <div>南偏西<span id="today_sun_azimuth"></span></div>
|
|
|
+ <div>北偏东<span id="today_moon_azimuth"></span></div>
|
|
|
+ <div>日月角<span id="angle_sun_e_moon"></span></div>
|
|
|
+ <div>月相角<span id="today_moon_angle"></span></div>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <script>
|
|
|
+ $("#title_text").html(localString[g_language].BE);
|
|
|
+ var g_coordinate_this = new Object();
|
|
|
+ var today = new Date();
|
|
|
+ var sun_times = new Object();
|
|
|
+ var curr_position = localStorage.getItem("local_position");
|
|
|
+ if (curr_position) {
|
|
|
+ g_coordinate_this.AT = curr_position.split("#")[0];
|
|
|
+ g_coordinate_this.LT = curr_position.split("#")[1];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ getLocation();
|
|
|
+ }
|
|
|
+ function show_time() {
|
|
|
+ if ($("#input_time").val()) {
|
|
|
+ today = new Date($("#input_time").val());
|
|
|
+ }
|
|
|
+ sun_times = SunCalc.getTimes(today, g_coordinate_this.AT, g_coordinate_this.LT, 0);
|
|
|
+ sun_position = SunCalc.getPosition(today, g_coordinate_this.AT, g_coordinate_this.LT);
|
|
|
+ moon_position = SunCalc.getMoonPosition(today, g_coordinate_this.AT, g_coordinate_this.LT);
|
|
|
+ moon_Illumination = SunCalc.getMoonIllumination(today)
|
|
|
+ $("#today_dawn").html(sun_times.dawn.toLocaleTimeString());
|
|
|
+ $("#today_solarNoon").html(sun_times.solarNoon.toLocaleTimeString());
|
|
|
+ $("#today_sunset").html(sun_times.sunset.toLocaleTimeString());
|
|
|
+ $("#today_sun_azimuth").html(angle_trans(sun_position.azimuth / Math.PI * 180));//太阳水平弧度
|
|
|
+ $("#today_moon_azimuth").html(angle_trans(moon_position.azimuth / Math.PI * 180));//月亮水平弧度
|
|
|
+ $("#today_moon_phase").html(moon_Illumination.phase);//月亮水平弧度
|
|
|
+ $("#today_moon_angle").html(angle_trans(moon_Illumination.angle / Math.PI * 180));//月亮水平弧度
|
|
|
+ $("#angle_sun_e_moon").html(angle_trans(Math.abs(Math.PI + sun_position.azimuth - moon_position.azimuth) / Math.PI * 180));//月亮水平弧度
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function getLocation() {//自动定位
|
|
|
+ if (navigator.geolocation) {
|
|
|
+ navigator.geolocation.getCurrentPosition(showPosition, showError);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $("#selected_position_string").html("Geolocation is not supported by this browser.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function showPosition(position) {
|
|
|
+ alert("get cordinate success");
|
|
|
+ g_coordinate_this.AT = position.coords.latitude;
|
|
|
+ g_coordinate_this.LT = position.coords.longitude;
|
|
|
+ let position_string = g_coordinate_this.AT + "#" + g_coordinate_this.LT
|
|
|
+ localStorage.setItem("local_position", position_string);
|
|
|
+
|
|
|
+ if (g_coordinate_this.AT >= 0) {
|
|
|
+ var AT_string = angle_trans(g_coordinate_this.AT) + "N";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ var AT_string = angle_trans(g_coordinate_this.AT) + "S";
|
|
|
+ }
|
|
|
+ if (g_coordinate_this.LT >= 0) {
|
|
|
+ var LT_string = angle_trans(g_coordinate_this.LT) + "E";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ var LT_string = angle_trans(g_coordinate_this.LT) + "W";
|
|
|
+ }
|
|
|
+ $("#selected_position_string").html(AT_string + " " + LT_string);
|
|
|
+
|
|
|
+ }
|
|
|
+ function showError(error) {
|
|
|
+ switch (error.code) {
|
|
|
+ case error.PERMISSION_DENIED:
|
|
|
+ alert("定位失败,用户拒绝请求地理定位");
|
|
|
+ break;
|
|
|
+ case error.POSITION_UNAVAILABLE:
|
|
|
+ alert("定位失败,位置信息是不可用");
|
|
|
+ break;
|
|
|
+ case error.TIMEOUT:
|
|
|
+ alert("定位失败,请求获取用户位置超时");
|
|
|
+ break;
|
|
|
+ case error.UNKNOWN_ERROR:
|
|
|
+ alert("定位失败,定位系统失效");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function angle_trans(angle) {
|
|
|
+ var angle_str = "";
|
|
|
+ var num_d = Math.floor(angle);
|
|
|
+ var num_m = Math.floor((angle - num_d) * 60);
|
|
|
+ var num_s = Math.round((angle - num_d) * 60 - num_m);
|
|
|
+ if (num_d != 0) {
|
|
|
+ angle_str += num_d + "°";
|
|
|
+ }
|
|
|
+ if (num_m != 0) {
|
|
|
+ angle_str += num_m + "’";
|
|
|
+ }
|
|
|
+ if (num_s != 0) {
|
|
|
+ angle_str += num_s + "”";
|
|
|
+ }
|
|
|
+ return (angle_str);
|
|
|
+ }
|
|
|
+
|
|
|
+ </script>
|
|
|
+
|
|
|
+
|
|
|
+</body>
|
|
|
+
|
|
|
+</html>
|