-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathindex.php
338 lines (320 loc) · 15.1 KB
/
index.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<?php
function sanitize_output($buffer) {
$search = [
'/\>[^\S ]+/s',
'/[^\S ]+\</s',
'/(\s)+/s',
'/<!--(.|\s)*?-->/'
];
$replace = [
'>',
'<',
'\\1',
''
];
$buffer = preg_replace($search, $replace, $buffer);
return $buffer . <<< EOL
<!--
⠀⠀⠀⠀ ⢀⠤⠒⠒⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡯⠴⠶⠶⠒⠢⢇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡎⡤⠖⠂⡀⠒⡢⡌⢣⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣷⠯⢭⣵⠑⣯⡭⢹⡎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡆⠀⢠⣤⠄⠀⣸⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣷⢄⣈⣟⢁⢴⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣀⢴⠒⡝⠁⠬⠛⣚⡩⠔⠉⢻⠒⣦⢄⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢀⢎⠁⡌⢰⠁⠀⠀⠀⠀⠀⠀⠀⢸⠀⡛⠀⡷⡀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣀⣾⣷⣠⠃⢸⠀⠀⠀⠀⠀⠀⠀⠀⣸⠀⢹⢰⠁⢳⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢸⡿⠟⢿⢳⡏⠀⠀⠀⠀⠀⠀⠀⢠⡟⣶⣘⢞⡀⠘⡆⠀⠀⠀⠀⠀
⠀⠀⠀⠀⡼⢺⣯⢹⢰⡏⠒⠒⠒⠊⠀⠐⢒⣾⣹⣸⢹⣾⡇⠀⢣⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣏⣾⠃⠀⣼⡟⣢⣀⡠⠤⣀⡰⢋⡝⣱⣹⠇⣿⣧⣴⠸⡄⠀⠀⠀⠀
⠀⠀⠀⠀⡏⡞⡆⢠⡇⣟⠭⡒⠭⠭⠤⠒⣡⠔⣽⡇⣂⣿⠟⠃⢀⡇⠀⠀⠀⠀
⠀⠀⠀⠀⢧⡇⡧⢫⠃⣷⣽⣒⣍⣉⣈⡩⢴⠾⡳⢡⢸⣛⣪⡗⢴⠁⠀⠀⠀⠀
⠀⠀⠀⠀⣼⢃⠷⣸⣤⣯⢞⡥⢍⣐⣂⠨⠅⠊⡠⢃⣟⢏⠹⣎⣆⡀⠀⠀⠀⠀
⠀⡠⠶⠚⠛⠛⠽⢹⡟⡖⢓⠿⣝⠓⠒⠒⠒⠭⢤⠗⣯⣩⣽⣿⠷⣾⣿⢷⣆⠀
⠜⣌⠢⢄⣀⡀⠀⡞⢡⠘⢄⠑⠨⢉⣀⠉⣀⠄⢊⠜⡸⠛⣿⡍⠉⠉⠈⢁⠁⠇
⠈⢯⡓⠦⠤⠬⠭⣵⠀⠱⢄⠑⠲⠤⠤⠤⠤⠒⢁⡔⠁⢠⣏⣡⣤⣤⡶⠜⣻⠃
⠀⠈⠙⠛⠒⠛⠻⠯⠕⠤⣀⣉⣓⣒⣂⣒⣒⣊⣁⣠⠔⠛⠂⠒⠛⠓⠛⠚⠉⠀
A-di-đà Phật
-->
EOL;
}
ob_start("sanitize_output");
session_start([
'read_and_close' => true,
]);
$ver = trim(file_get_contents("VERSION"));
require_once("lib/functions.inc.php");
list ($st, $info) = login_info();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name = "viewport" content = "width=device-width, initial-scale=1.0, user-scalable=0">
<title>地圖瀏覽器 v<?=$ver?></title>
<script src="//maps.googleapis.com/maps/api/js?v=3&key=<?php echo $CONFIG['gmap_api_key']; ?>&libraries=geometry,drawing&callback=Function.prototype"></script>
<script src="https://code.jquery.com/jquery-3.7.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/redmond/jquery-ui.css">
<!--
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<link type="text/css" href="https://code.jquery.com/ui/1.11.4/themes/flick/jquery-ui.css" rel="Stylesheet" />
-->
<link href="css/font-awesome.min.css" rel="stylesheet" />
<!-- build:js js/vender.js -->
<script src="js/ui.dropdownchecklist.js" charset="utf-8"></script>
<script src='js/proj4js-combined.js'></script>
<script src="js/infobox.js"></script>
<script src='js/ExtDraggableObject.js'></script>
<script src="js/label.js"></script>
<script src="js/oms.min.js"></script>
<script src='js/jquery.blockUI.js'></script>
<script src='js/jquery.meerkat.1.3.js'></script>
<script src="js/iframeResizer.contentWindow.min.js"></script>
<script src="js/geolocationmarker.js"></script>
<script src="js/v3_ll_grat.js"></script>
<script src="js/jquery-autoGrowInput.js" charset="utf-8"></script>
<script src="js/jquery.geolocation.js" charset="utf-8"></script>
<script src="js/jquery.cookie.js"></script>
<script src="js/jqbrowser.js"></script>
<script src="js/ProjectedOverlay.js"></script>
<script src="js/geoxml3.js"></script>
<script src="js/functions.js"></script>
<script src="js/javascript.util.min.js"></script>
<script src="js/jsts.min.js"></script>
<script src="js/jquery.noty.js"></script>
<script src="js/shapedraw.js"></script>
<script src="js/loadgpx.js"></script>
<!-- endbuild -->
<!-- build:css css/twmap3.css -->
<link rel="stylesheet" type="text/css" href="css/twmap3_main.css" />
<!-- endbuild -->
<script>
<?php
// 檢查是否登入
if ($st === true) {
echo "var login_role = 1;\n";
printf("var login_uid = %d;\n",$info['uid']);
} else {
echo "var login_role = 0;\n";
}
printf("var getkml_url = '%s';",$CONFIG['getkml_url']);
printf("var geocodercache_url = '%s';",$CONFIG['geocodercache_url']);
printf("var pointdata_url = '%s';",$CONFIG['pointdata_url']);
printf("var pointdata_admin_url = '%s';",$CONFIG['pointdata_admin_url']);
printf("var promlist_url = '%s';", $CONFIG['promlist_url']);
printf("var get_waypoints_url = '%s';",$CONFIG['get_waypoints_url']);
printf("var get_elev_url = '%s';",$CONFIG['get_elev_url']);
printf("var viewshed_url = '%s';",$CONFIG['viewshed_url']);
printf("var exportkml_url = '%s';", $CONFIG['exportkml_url']);
printf("var poisearch_url = '%s';", $CONFIG['poisearch_url']);
printf("var callmake_url = '%s';", $CONFIG['site_twmap_html_root'] . "main.php?tab=0&");
printf("var shorten_url = '%s';",$CONFIG['shorten_url']);
?>
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q1DHK68EH5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Q1DHK68EH5');
</script>
</head>
<body>
<div id="loading">
歡迎使用 地圖瀏覽器 v<?=$ver?><br>
<img src="icon/twmap3.jpg"><p>
<img src="img/loading20x20.gif"> 載入中...
</div>
<div id="locContainer">
<div id="loc"></div>
</div>
<div id="opContainer" >
<!-- https://fontawesome.com/cheatsheet?from=io#social-buttons -->
<div id="mapIdControl" title="選擇地圖">
<select title="切換背景圖" name="changebmap" id="changebmap" style="height: 32px; font-weight: 900;font-family: FontAwesome">
<option value="jm20k_1904"> 堡圖1904</option>
<option value="jm20k_1904_tri"> 三角點1904</option>
<option value="fandi"> 蕃地1916</option>
<option value="jm20k_1921"> 堡圖1921</option>
<option value="jm50k"> 陸測1924</option>
<option value="jm50k_1924"> 陸測1924新</option>
<option value="tw50k"> 老五萬1956</option>
<option value="tm50k_1966"> 水利1966</option>
<option value="geo2016"> 地質圖</option>
<option value="twmapv1"> 經建1 1989</option>
<option value="tri1999"> 林崇雄百岳圖</option>
<option value="tw5kariel"> TW5K 2000</option>
<option value="taiwan"> 經建3 2001</option>
<option value="moi_osm"> 魯地圖</option>
<option value="moi_osm_en"> RUDY</option>
<option value="nlsc_emap"> EMAP5</option>
<option value="roadmap"> Google圖</option>
<option value="terrain"> 地形圖</option>
<option value="hillshading"> 陰影</option>
<option value="theme"> 主題</option>
<option value="debug"> 除錯</option>
<option value="satellite"> 衛星圖</option>
<option value="atis"> 農航所</option>
<option value="nlsc_photo_mix"> nlsc正射圖</option>
</select>
</div>
<div id="less" title="背景清楚一點">
-
</div>
<div id="opSlider">
透明度 (<span id='opv'></span>)%
<div id="op" title="拉我調整透明度"> </div>
</div>
<div id="more" title="前景清楚一點">
+
</div>
<!-- <button type="button" id="changemap" name="changemap" title="切換一版與三版地形圖" >經建三</button>-->
<div id="CGMAP">
<select title="切換前景圖" name="changemap" id="changemap" style="height: 32px; font-family: FontAwesome, Ariel">
<option value="moi_osm"> 魯地圖</option>
<option value="tw25k_v3"> 經建三</option>
<option value="tw25k_v1"> 經建一</option>
</select>
</div>
<div id='CGNAME'>
<select title="切換路圖" name="road" id="changegname" style="height: 32px; font-family: FontAwesome, Ariel;">
<option value="GoogleNames"> 道路</option>
<option value="HL20240403">2024新崩坍</option>
<option value="NLSCNames">nlsc 道路</option>
<option value="RUDY_BN">魯地圖BN</option>
<option value="RUDY_DN">魯地圖DN</option>
<option value="Happyman">Happyman</option>
<option value="Compartment">林班界</option>
<option value="MOI_CONTOUR2">等高線2015</option>
<option value="MOI_CONTOUR">等高線2005</option>
<option value="None">無道路</option></select>
</div>
</div>
<div id="map_canvas" data-tap-disabled="true"></div>
<div id="drop-container"><div id="drop-silhouette"></div></div> <div id="title" class="title">
<form id="gotoform" name="gotoform">
<span id="about" title="關於" class="ui-state-default ui-corner-all" > 地圖瀏覽器 v<?=$ver?></span> <span id="search_text"><img src='img/loading20x20.gif' /></span> <input id="tags" type="text" class="ui-corner-all" title="輸入山頭名稱或地標,或者座標" disabled>
<button type=button class="ui-state-default ui-corner-all" id="goto" title="搜尋並定位">到</button>
<button id="kml_sw" class="ui-state-default ui-corner-all" title="山友登山軌跡(支援z=13到18)" type=button>行跡</button>
<button id="label_sw" class="ui-state-default ui-corner-all" title="三角點名稱" type=button>標籤</button>
<!-- <button id="delaunay_sw" class="ui-state-default ui-corner-all disable" title="三角點連線" type=button>連線</button> -->
<button id="marker_reload" class="ui-state-default ui-corner-all" type=button>重載</button>
<select id="marker_sw_select" multiple="multiple">
<option selected="selected" value="a">全部</option>
<option selected="selected" value="1">一等</option>
<option selected="selected" value="2">二等</option>
<option selected="selected" value="3">三等</option>
<option selected="selected" value="4">森林</option>
<option selected="selected" value="5">百岳</option>
<option selected="selected" value="6">小百岳</option>
<option selected="selected" value="9">百名山</option>
<option selected="selected" value="8">溫泉</option>
<option selected="selected" value="10">獨立峰</option>
<option selected="selected" value="11">駐在所</option>
<option selected="selected" value="7">其他</option>
</select>
</form>
</div>
<div id="params"></div>
<button type="button" id="setup" name="setup" style='display:none' class="ui-state-default ui-corner-all">設定</button>
<div id="CGRID">
<select title="切換 Grid" name="grid" id="changegrid" class="ui-corner-all">
<option value="TWD67" selected >TWD67 Grid</option><option value="TWD67PH">TWD67澎</option><option value="WGS84">經緯度</option><option value="None">無Grid</option>
<option value="TWD67_EXT">TWD67 EXT</option><option value="TWD97" >TWD97 Grid</option><option value="TWD97PH">TWD97澎</option><option value="TWD97_EXT">TWD97 EXT</option>
</select>
</div>
<div id="FORECAST">
<select title="雨量" name="rainfall" id="rainfall" class="ui-corner-all">
<option value="none" selected >雨量圖</option>
<option value="o2d" >前日</option>
<option value="o1d" >昨日</option>
<option value="now" >今日</option>
<option value="f12h" >未來12h</option>
<option value="f24h" >未來24h</option>
</select>
</div>
<div id="MCOVERAGE">
<select title="訊號" mame="mcover" id="mcover" class="ui-corner-all">
<option value="none" selected>訊號</option>
<option value="cht3G">cht3G</option>
<option value="cht">cht4+5G</option>
<option value="twn3G">twn3G</option>
<option value="twn">twn4+5G</option>
<option value="fet3G">fet3G</option>
<option value="fet">fet4+5G</option>
<option value="aptg">aptg4+5G</option>
</select>
</div>
<div id="inputtitleform" style="display:none">
<br>請輸入地圖標題: <br><br><input id="inputtitle" type="text" size="2" />
<br>
<select id="datum">
<option value="TWD67" >TWD67 紅色框</option>
<option value="TWD97" selected>TWD97 綠色框</option>
</select>
<br>
<input type="button" id='inputtitlebtn' value="送出" />
<input type="button" id='inputtitlebtn2' value="取消" />
</div>
<div id="mobile_setup">
<a href="#" class="close-meerkat2">close</a>
<div id="mobile_export_kml">
<button id="export_kml" class="ui-state-default ui-corner-all">下載圖資</button>
</div>
</div>
<div id="meerkat">
<a href="#" class="close-meerkat">close</a>
<div id="meerkat-content">
Here we go :*
</div>
<div id="copylink" title="複製連結">
<input id="copylinkurl"><br>
<button type="button" id="copylinkurlgo">Go</button>
<button type="button" id="copylinkurlshort">Shorten</button>
</div>
</div>
<div id="ranking">
<iframe id="ranking_iframe" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="100%" allowfullscreen></iframe>
</div>
<div id="consolediv" style="display:hidden"> <textarea id="console" readonly="readonly" style="width:100%;height:100%;border:0px;margin:0px;background-color:#e0f0a0;"></textarea></div>
<div id="buttons" style="font-family: Font Awesome\ 5 Free; padding: 2px; margin-top: 2px">
<button title="刪除形狀" id="delete-button"><i class="fa fa-times"></i></button>
<button title="刪除全部形狀" id="clear-button"><i class="fa fa-times-circle"></i></button>
<button title="顯示形狀資訊" id="shapeinfo-button"><i class="fa fa-info"></i></button>
</div>
<div id="msg" style="background-color: white;">
</div>
<script>
$(function() {
$.getScript( "js/main.js?ts=<?php echo time();?>" ).done(function() {
initialize();
$(window).resize(function() {
resizeMap();
});
$('input').autoGrowInput({
comfortZone: 20,
maxWidth: 2000
});
/* accept message from iframe (point3 admin) */
window.onmessage = function(e){
if (e.data.function == 'markerReloadSingle') {
markerReloadSingle(e.data);
}
};
});
});
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q1DHK68EH5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Q1DHK68EH5');
</script>
</body>
</html>