Skip to content

Commit

Permalink
地圖瀏覽器 v4.34 add 日治三角點圖層
Browse files Browse the repository at this point in the history
  • Loading branch information
happyman committed Dec 9, 2022
1 parent d31bb02 commit 8f9e873
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 54 deletions.
2 changes: 1 addition & 1 deletion twmap3/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.33
4.34
10 changes: 5 additions & 5 deletions twmap3/config.inc.php.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ $protocol = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https://"
$site_url = $protocol . "map.happyman.idv.tw";

// 地圖瀏覽器的 url prefix
$site_html_root = "/~happyman/twmap3/";
$site_html_root = "/map/";
// 地圖產生器 url prefix
$site_twmap_html_root = "/twmap/";
$site_twmap_html_root = "/gen/";
//

$CONFIG['site_twmap_html_root'] = "/twmap/";
$CONFIG['site_twmap_html_root'] = "/gen/";
$CONFIG['getkmlfrombounds_url'] = $site_twmap_html_root ."api/getkmlfrombounds.php";
$CONFIG['geocodercache_url'] = $site_twmap_html_root ."api/geocoder.php";
$CONFIG['getkml_url'] = $site_twmap_html_root ."api/getkml.php";
Expand All @@ -26,7 +26,7 @@ $CONFIG['poisearch_url'] = $site_twmap_html_root . "api/poi_search.php";
$CONFIG['shorten_url'] = $site_twmap_html_root . "api/shorten.php";

// 資料庫連線參數
$CONFIG['db'] = array('host'=> 'localhost', 'db' => 'twmap', 'user'=> 'user', 'pass' => 'password');
$CONFIG['db'] = array('host'=> '', 'db' => '', 'user'=> '', 'pass' => '');
// admin user 的 uid 為 登入地圖產生器的帳號
$CONFIG['admin'] = array("");
$CONFIG['admin'] = array("3");
$CONFIG['gmap_api_key'] = '';
1 change: 1 addition & 0 deletions twmap3/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function gtag(){dataLayer.push(arguments);}
<div id="mapIdControl" title="選擇地圖">
<select title="切換背景圖" name="changebmap" id="changebmap" style="height: 32px; font-weight: 900;font-family: FontAwesome">
<option value="jm20k_1904">&#xf1da; &nbsp;堡圖1904</option>
<option value="jm20k_1904_tri">&#xf1da; &nbsp;三角點1904</option>
<option value="fandi">&#xf1da; &nbsp;蕃地1916</option>
<option value="jm20k_1921">&#xf1da; &nbsp;堡圖1921</option>
<option value="jm50k">&#xf1da; &nbsp;陸測1924</option>
Expand Down
12 changes: 12 additions & 0 deletions twmap3/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,16 @@ var JM20K1904_MapType = new google.maps.ImageMapType({
maxZoom: 18

});
var JM20K1904_triangulation_MapType = new google.maps.ImageMapType({
getTileUrl: function (a, b) {
return "//gis.sinica.edu.tw/tileserver/file-exists.php?img=JM20K_1904_triangulation-png-"+b+"-"+a.x+"-"+a.y;
},
tileSize: new google.maps.Size(256, 256),
name: "三角點",
alt: "日治初期台灣三角測量點及水準點配置圖",
maxZoom: 16

});
var Geo2016_Options = {
getTileUrl: function (a, b) {
// var y_tms = (1 << b) - a.y - 1;
Expand Down Expand Up @@ -507,6 +517,7 @@ var copyrights = {
'tm50k_1966': "<a target=\"_blank\" href=\"http://gis.rchss.sinica.edu.tw/mapdap/?p=6190\">台灣歷史百年地圖</a> - 水利圖 1966",
'jm20k_1921': "<a target=\"_blank\" href=\"http://ndaip.sinica.edu.tw/content.jsp?option_id=2621&index_info_id=6924\">台灣堡圖(大正版)</a>",
'jm20k_1904': "<a target=\"_blank\" href=\"http://gissrv4.sinica.edu.tw/gis/twhgis.aspx\">台灣歷史百年地圖</a> - 台灣堡圖(明治版)</a>",
'jm20k_1904_tri': "<a target=\"_blank\" href=\"https://gis.rchss.sinica.edu.tw/mapclub_20221208/\">台灣歷史百年地圖</a> - 《三角測量點及水準測量點明細表》之附圖</a>",
'tw5kariel': "台灣5000:1相片基本圖"
};
var logos = {
Expand Down Expand Up @@ -2245,6 +2256,7 @@ function initialize() {
map.mapTypes.set('debug',DebugTile_MapType);
map.mapTypes.set('geo2016',Geo2016_MapType);
map.mapTypes.set('jm20k_1904', JM20K1904_MapType);
map.mapTypes.set('jm20k_1904_tri', JM20K1904_triangulation_MapType);
map.mapTypes.set('jm20k_1921', JM20K1921_MapType);
map.mapTypes.set('tm50k_1966', TM50K1966_MapType);
map.mapTypes.set('jm50k', JM50K1924_MapType);
Expand Down
2 changes: 1 addition & 1 deletion twmap_gen/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.91
3.0
62 changes: 19 additions & 43 deletions twmap_gen/config.inc.php.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
//ini_set("session.gc_maxlifetime", 86400);
// set this in php ini
// $Id$
define('__ROOT__', dirname(__FILE__). "/");
require_once(__ROOT__."vendor/autoload.php");
Expand All @@ -10,28 +12,28 @@ require_once(__ROOT__."lib/phpwee-php-minifier/phpwee.php");
$protocol = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https://" : "http://";
$out_root = "/srv/www/htdocs/map/out";
// tmpdir for backend_make
$out_root_tmp = "/home/nas/twmapcache/tmp/out";
$out_html_root = "/map/out";
$out_root_tmp = "/home/happyman/twmapcache/tmp/out";
$out_html_root = "/out";
$site_url = $protocol . "map.happyman.idv.tw";
$site_html_root = "/twmap";
$site_html_root = "/gen";
// 30 for SuSE, 33 for Ububtu
define('WWWRUN_UID', 33);
define('WWWRUN_UID', 1001);

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

// 不重要
//if (!file_exists($tilepath."/16")) {
// die("image dir not ready");
//}
$tmppath = "/home/nas/twmapcache/tmp";
$diskfullchk = "/home/nas/";
$tmppath = "/home/happyman/twmapcache/tmp";
$diskfullchk = "/home/happyman/map/";
$twmap_gen_version = trim(file_get_contents(__ROOT__."VERSION"));
$TWMAP3_html_root = "/~happyman/twmap3";
$TWMAP3URL = "/~happyman/twmap3/index.php";
$TWMAP3_html_root = "/map";
$TWMAP3URL = "/map/index.php";
$BETA = 0; // beta for debug output
$ERROROUT = "ajax";

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

/* DB 設定寫在這裡 */
$db_host = 'localhost';
$db_user = "twmap";
$db_pass = "password";
$db_name = "twmap";
$db_host = '';
$db_user = "";
$db_pass = "";
$db_name = "";
$db_port = '5432';
$db_dsn = sprintf("postgres9://%s:%s@%s:%s/%s?persist",$db_user,$db_pass,$db_host,$db_port,$db_name);
$db_dsn = sprintf("postgres9://%s:%s@%s:%s/%s",$db_user,$db_pass,$db_host,$db_port,$db_name);
$gdal_dsn = sprintf("PG:dbname='%s' user='%s' password='%s' host='%s' port='%s'",$db_name,$db_user,$db_pass,$db_host,$db_port);


// 需要申請一把 xuite / facebook 的 api key
// api.xuite.net
require_once(__ROOT__."lib/twmapdb.inc.php");
/* login */
if (php_sapi_name() != "cli") {

require_once(__ROOT__."lib/xuite.php");
require_once __ROOT__."lib/Hybrid/Hybrid/thirdparty/Facebook/base_facebook.php";
require_once __ROOT__."lib/Hybrid/Hybrid/thirdparty/Facebook/facebook.php";

//require_once(__ROOT__."lib/openid.php");
// move to config-hybridauth.php
$fb_appid = '';
$facebook = new Facebook(array(
'appId' => $fb_appid,
// here
'secret' => '',
// 'cookie' => false,
));
// here
$xuite = new xuiteAuth(array(
'api_key' => '',
'secret' => ''));

/* template */
//require_once(__ROOT__."lib/twmapdb.inc.php");
$smarty = new Smarty();
// composer autoload require_once(__ROOT__."lib/smarty/Smarty.class.php");
require_once(__ROOT__."lib/smarty-out-jsmin.inc.php");
Expand All @@ -105,10 +87,6 @@ if (php_sapi_name() != "cli") {
$smarty->assign('twmap3_html_root',$TWMAP3_html_root);

}
else {
// special include for CLI
//
}
require_once __ROOT__."lib/ape/ApeAbstractConnection.php";
require_once __ROOT__."lib/ape/ApeClient.php";
require_once __ROOT__."lib/ape/ApeCurlConnection.php";
Expand All @@ -120,16 +98,14 @@ require_once __ROOT__."lib/ape/ApeResponse.php";

#

ini_set("session.gc_maxlifetime", 86400);

# Keppon API : queue
define('GEARMAN_SERVER','127.0.0.1');


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

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

0 comments on commit 8f9e873

Please sign in to comment.