Skip to content

Commit 8f9e873

Browse files
committed
地圖瀏覽器 v4.34 add 日治三角點圖層
1 parent d31bb02 commit 8f9e873

File tree

7 files changed

+42
-54
lines changed

7 files changed

+42
-54
lines changed

twmap3/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.33
1+
4.34

twmap3/config.inc.php.sample

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ $protocol = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https://"
44
$site_url = $protocol . "map.happyman.idv.tw";
55

66
// 地圖瀏覽器的 url prefix
7-
$site_html_root = "/~happyman/twmap3/";
7+
$site_html_root = "/map/";
88
// 地圖產生器 url prefix
9-
$site_twmap_html_root = "/twmap/";
9+
$site_twmap_html_root = "/gen/";
1010
//
1111

12-
$CONFIG['site_twmap_html_root'] = "/twmap/";
12+
$CONFIG['site_twmap_html_root'] = "/gen/";
1313
$CONFIG['getkmlfrombounds_url'] = $site_twmap_html_root ."api/getkmlfrombounds.php";
1414
$CONFIG['geocodercache_url'] = $site_twmap_html_root ."api/geocoder.php";
1515
$CONFIG['getkml_url'] = $site_twmap_html_root ."api/getkml.php";
@@ -26,7 +26,7 @@ $CONFIG['poisearch_url'] = $site_twmap_html_root . "api/poi_search.php";
2626
$CONFIG['shorten_url'] = $site_twmap_html_root . "api/shorten.php";
2727

2828
// 資料庫連線參數
29-
$CONFIG['db'] = array('host'=> 'localhost', 'db' => 'twmap', 'user'=> 'user', 'pass' => 'password');
29+
$CONFIG['db'] = array('host'=> '', 'db' => '', 'user'=> '', 'pass' => '');
3030
// admin user 的 uid 為 登入地圖產生器的帳號
31-
$CONFIG['admin'] = array("");
31+
$CONFIG['admin'] = array("3");
3232
$CONFIG['gmap_api_key'] = '';

twmap3/index.php

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ function gtag(){dataLayer.push(arguments);}
101101
<div id="mapIdControl" title="選擇地圖">
102102
<select title="切換背景圖" name="changebmap" id="changebmap" style="height: 32px; font-weight: 900;font-family: FontAwesome">
103103
<option value="jm20k_1904">&#xf1da; &nbsp;堡圖1904</option>
104+
<option value="jm20k_1904_tri">&#xf1da; &nbsp;三角點1904</option>
104105
<option value="fandi">&#xf1da; &nbsp;蕃地1916</option>
105106
<option value="jm20k_1921">&#xf1da; &nbsp;堡圖1921</option>
106107
<option value="jm50k">&#xf1da; &nbsp;陸測1924</option>

twmap3/js/main.js

+12
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,16 @@ var JM20K1904_MapType = new google.maps.ImageMapType({
430430
maxZoom: 18
431431

432432
});
433+
var JM20K1904_triangulation_MapType = new google.maps.ImageMapType({
434+
getTileUrl: function (a, b) {
435+
return "//gis.sinica.edu.tw/tileserver/file-exists.php?img=JM20K_1904_triangulation-png-"+b+"-"+a.x+"-"+a.y;
436+
},
437+
tileSize: new google.maps.Size(256, 256),
438+
name: "三角點",
439+
alt: "日治初期台灣三角測量點及水準點配置圖",
440+
maxZoom: 16
441+
442+
});
433443
var Geo2016_Options = {
434444
getTileUrl: function (a, b) {
435445
// var y_tms = (1 << b) - a.y - 1;
@@ -507,6 +517,7 @@ var copyrights = {
507517
'tm50k_1966': "<a target=\"_blank\" href=\"http://gis.rchss.sinica.edu.tw/mapdap/?p=6190\">台灣歷史百年地圖</a> - 水利圖 1966",
508518
'jm20k_1921': "<a target=\"_blank\" href=\"http://ndaip.sinica.edu.tw/content.jsp?option_id=2621&index_info_id=6924\">台灣堡圖(大正版)</a>",
509519
'jm20k_1904': "<a target=\"_blank\" href=\"http://gissrv4.sinica.edu.tw/gis/twhgis.aspx\">台灣歷史百年地圖</a> - 台灣堡圖(明治版)</a>",
520+
'jm20k_1904_tri': "<a target=\"_blank\" href=\"https://gis.rchss.sinica.edu.tw/mapclub_20221208/\">台灣歷史百年地圖</a> - 《三角測量點及水準測量點明細表》之附圖</a>",
510521
'tw5kariel': "台灣5000:1相片基本圖"
511522
};
512523
var logos = {
@@ -2245,6 +2256,7 @@ function initialize() {
22452256
map.mapTypes.set('debug',DebugTile_MapType);
22462257
map.mapTypes.set('geo2016',Geo2016_MapType);
22472258
map.mapTypes.set('jm20k_1904', JM20K1904_MapType);
2259+
map.mapTypes.set('jm20k_1904_tri', JM20K1904_triangulation_MapType);
22482260
map.mapTypes.set('jm20k_1921', JM20K1921_MapType);
22492261
map.mapTypes.set('tm50k_1966', TM50K1966_MapType);
22502262
map.mapTypes.set('jm50k', JM50K1924_MapType);

twmap_gen/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.91
1+
3.0

twmap_gen/config.inc.php.sample

+19-43
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
//ini_set("session.gc_maxlifetime", 86400);
3+
// set this in php ini
24
// $Id$
35
define('__ROOT__', dirname(__FILE__). "/");
46
require_once(__ROOT__."vendor/autoload.php");
@@ -10,28 +12,28 @@ require_once(__ROOT__."lib/phpwee-php-minifier/phpwee.php");
1012
$protocol = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https://" : "http://";
1113
$out_root = "/srv/www/htdocs/map/out";
1214
// tmpdir for backend_make
13-
$out_root_tmp = "/home/nas/twmapcache/tmp/out";
14-
$out_html_root = "/map/out";
15+
$out_root_tmp = "/home/happyman/twmapcache/tmp/out";
16+
$out_html_root = "/out";
1517
$site_url = $protocol . "map.happyman.idv.tw";
16-
$site_html_root = "/twmap";
18+
$site_html_root = "/gen";
1719
// 30 for SuSE, 33 for Ububtu
18-
define('WWWRUN_UID', 33);
20+
define('WWWRUN_UID', 1001);
1921

2022
// 放一版的圖資目錄
2123
$stbpath = 'http://make.happyman.idv.tw/~happyman/stb';
2224
// 放從 TMS 的圖磚
2325
// 放3版 1x1 的圖檔
24-
$tilecachepath = "/mnt/twmapcache/cache";
26+
$tilecachepath = "/home/happyman/twmapcache/cache";
2527

2628
// 不重要
2729
//if (!file_exists($tilepath."/16")) {
2830
// die("image dir not ready");
2931
//}
30-
$tmppath = "/home/nas/twmapcache/tmp";
31-
$diskfullchk = "/home/nas/";
32+
$tmppath = "/home/happyman/twmapcache/tmp";
33+
$diskfullchk = "/home/happyman/map/";
3234
$twmap_gen_version = trim(file_get_contents(__ROOT__."VERSION"));
33-
$TWMAP3_html_root = "/~happyman/twmap3";
34-
$TWMAP3URL = "/~happyman/twmap3/index.php";
35+
$TWMAP3_html_root = "/map";
36+
$TWMAP3URL = "/map/index.php";
3537
$BETA = 0; // beta for debug output
3638
$ERROROUT = "ajax";
3739

@@ -55,41 +57,21 @@ $pixels['A3R'] = array("x"=>2984, "y"=>2110);
5557
$fuzzy = 20;
5658

5759
/* DB 設定寫在這裡 */
58-
$db_host = 'localhost';
59-
$db_user = "twmap";
60-
$db_pass = "password";
61-
$db_name = "twmap";
60+
$db_host = '';
61+
$db_user = "";
62+
$db_pass = "";
63+
$db_name = "";
6264
$db_port = '5432';
63-
$db_dsn = sprintf("postgres9://%s:%s@%s:%s/%s?persist",$db_user,$db_pass,$db_host,$db_port,$db_name);
65+
$db_dsn = sprintf("postgres9://%s:%s@%s:%s/%s",$db_user,$db_pass,$db_host,$db_port,$db_name);
6466
$gdal_dsn = sprintf("PG:dbname='%s' user='%s' password='%s' host='%s' port='%s'",$db_name,$db_user,$db_pass,$db_host,$db_port);
6567

6668

67-
// 需要申請一把 xuite / facebook 的 api key
68-
// api.xuite.net
6969
require_once(__ROOT__."lib/twmapdb.inc.php");
7070
/* login */
7171
if (php_sapi_name() != "cli") {
72-
7372
require_once(__ROOT__."lib/xuite.php");
74-
require_once __ROOT__."lib/Hybrid/Hybrid/thirdparty/Facebook/base_facebook.php";
75-
require_once __ROOT__."lib/Hybrid/Hybrid/thirdparty/Facebook/facebook.php";
76-
77-
//require_once(__ROOT__."lib/openid.php");
78-
// move to config-hybridauth.php
7973
$fb_appid = '';
80-
$facebook = new Facebook(array(
81-
'appId' => $fb_appid,
82-
// here
83-
'secret' => '',
84-
// 'cookie' => false,
85-
));
86-
// here
87-
$xuite = new xuiteAuth(array(
88-
'api_key' => '',
89-
'secret' => ''));
90-
9174
/* template */
92-
//require_once(__ROOT__."lib/twmapdb.inc.php");
9375
$smarty = new Smarty();
9476
// composer autoload require_once(__ROOT__."lib/smarty/Smarty.class.php");
9577
require_once(__ROOT__."lib/smarty-out-jsmin.inc.php");
@@ -105,10 +87,6 @@ if (php_sapi_name() != "cli") {
10587
$smarty->assign('twmap3_html_root',$TWMAP3_html_root);
10688

10789
}
108-
else {
109-
// special include for CLI
110-
//
111-
}
11290
require_once __ROOT__."lib/ape/ApeAbstractConnection.php";
11391
require_once __ROOT__."lib/ape/ApeClient.php";
11492
require_once __ROOT__."lib/ape/ApeCurlConnection.php";
@@ -120,16 +98,14 @@ require_once __ROOT__."lib/ape/ApeResponse.php";
12098

12199
#
122100

123-
ini_set("session.gc_maxlifetime", 86400);
124-
125101
# Keppon API : queue
126102
define('GEARMAN_SERVER','127.0.0.1');
127103

128104

129-
define('APE_HOST','0.ape.happyman.idv.tw');
130-
$CONFIG['admin'] = array();
105+
define('APE_HOST','0.ape.tile.happyman.idv.tw');
106+
$CONFIG['admin'] = array( 3 );
131107
// gdalwarp -t_srs EPSG:4326 dem_20m.tif dem_20m-latlong.tif
132108
// source: http://data.gov.tw/node/35430
133109
define('twDEM_path', __ROOT__ ."db/DEM/dem_20m-latlong.tif");
134-
$CONFIG['poi_file'] = "/home/mountain/mapsforge/20171008/MOI_OSM_Taiwan_TOPO_Rudy.poi";
110+
$CONFIG['poi_file'] = "/home/happyman/poi/MOI_OSM_Taiwan_TOPO_Rudy.poi";
135111

twmap_gen/pages/about.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,16 @@
2222
<p>
2323
歡迎幫忙,完整原始碼在 <a href="https://github.com/happyman/twmap">https://github.com/happyman/twmap</a>,歡迎 fork / feedback.
2424
<p><b>Powered by</b></p>
25-
<p>Ubuntu Linux、PHP 7.x、HybridAuth、google maps API、imagemagick、gpsbabel、proj、inkscape、Ghostscript、APE comet server、...</p>
25+
<p>Ubuntu Linux、PHP 8.x、HybridAuth、google maps API、imagemagick、gpsbabel、proj、inkscape、Ghostscript、APE comet server、...</p>
2626
<p><b>Hosted on</b></p>
2727
<p>高雄大學資管系(NUKIM)、中央研究院人文社會科學研究中心(SINICA) 感謝感謝~</p>
28-
<p><b>Other Information</b></p>
29-
<p><a href='http://map.happyman.idv.tw/~mountain/fb/privacy.php' target=_blank>隱私條款(Privacy Policy)</a>
30-
<p><a href='http://map.happyman.idv.tw/~mountain/fb/delete.php' target=_blank>使用者資料刪除(Request for account deletion)</a>
3128
<p>
3229
<img src='imgs/discuss_icon.png'/>
3330
<a href='https://www.facebook.com/twmapgen/' target="_blank" class="ui-state-default ui-corner-all hp">建議或討論</a>
3431
<p><b>更新紀錄</b>
3532
<pre>
33+
2022/12/09 地圖產生器 v3.0 配合升級 php8.1 修正, github auth
34+
2022/12/09 地圖瀏覽器 v4.34 加上<a hrf='https://gis.rchss.sinica.edu.tw/mapclub_20221208/'>日治初期三角點圖層</a>
3635
2021/03/22 地圖產生器 v2.91 加上microtsoft,移除xuite oauth登入.
3736
2020/09/11 地圖瀏覽器 v4.33 加上英文版魯地圖
3837
2020/05/22 地圖瀏覽器 v4.32 加上台灣地質圖(2016)

0 commit comments

Comments
 (0)