@maplat/ui 0.10.4 → 0.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +223 -223
- package/README.md +91 -91
- package/dist/assets/locales/en/translation.json +64 -64
- package/dist/assets/locales/ja/translation.json +64 -64
- package/dist/assets/locales/ko/translation.json +65 -65
- package/dist/assets/locales/zh/translation.json +65 -65
- package/dist/assets/locales/zh-TW/translation.json +65 -65
- package/dist/assets/maplat.css +2 -2
- package/dist/assets/maplat.css.map +1 -1
- package/dist/assets/maplat.js +1 -1
- package/dist/assets/maplat.js.LICENSE.txt +1 -1
- package/dist/assets/maplat.js.map +1 -1
- package/dist/index.html +125 -37
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.LICENSE.txt +1 -1
- package/dist/service-worker.js.map +1 -1
- package/legacy/bootstrap-native.js +1934 -1934
- package/legacy/detect-element-resize.js +153 -153
- package/legacy/iziToast.js +1301 -1301
- package/legacy/page.js +1153 -1153
- package/legacy/qrcode.js +616 -616
- package/less/bootstrap.less +7010 -7010
- package/less/font-awesome.less +30 -30
- package/less/font-face.less +10 -10
- package/less/font-face_packed.less +11 -11
- package/less/iziToast.less +1732 -1732
- package/less/maplat-specific.less +652 -652
- package/less/ui.less +11 -11
- package/less/ui_packed.less +10 -10
- package/locales/en/translation.json +64 -64
- package/locales/ja/translation.json +64 -64
- package/locales/ko/translation.json +65 -65
- package/locales/zh/translation.json +65 -65
- package/locales/zh-TW/translation.json +65 -65
- package/package.json +106 -105
- package/src/index.js +31 -7
- package/src/maplat_control.js +25 -7
- package/src/service-worker.js +1 -1
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"control": {
|
|
3
|
-
"compass": "停止旋轉",
|
|
4
|
-
"info": "顯示地圖信息",
|
|
5
|
-
"zoom": "地圖尺寸調整",
|
|
6
|
-
"gps": "獲取GPS位置",
|
|
7
|
-
"home": "返回起點",
|
|
8
|
-
"help": "查看幫助",
|
|
9
|
-
"trans": "調整地圖透明度",
|
|
10
|
-
"share": "分享",
|
|
11
|
-
"hide_marker": "隱藏標記",
|
|
12
|
-
"border": "顯示地圖邊界"
|
|
13
|
-
},
|
|
14
|
-
"html": {
|
|
15
|
-
"close": "關閉",
|
|
16
|
-
"app_loading_body": "正在上傳中……",
|
|
17
|
-
"acquiring_gps": "獲取GPS數據中",
|
|
18
|
-
"author": "作者",
|
|
19
|
-
"createdAt": "創建日期",
|
|
20
|
-
"era": "對象所處時期",
|
|
21
|
-
"contributor": "收藏捐贈者",
|
|
22
|
-
"mapper": "製圖人",
|
|
23
|
-
"license": "地圖許可",
|
|
24
|
-
"dataLicense": "映射數據許可",
|
|
25
|
-
"attr": "地圖版權",
|
|
26
|
-
"dataAttr": "映射數據版權",
|
|
27
|
-
"reference": "來源參考",
|
|
28
|
-
"description": "說明",
|
|
29
|
-
"cache_handle": "地圖緩存佔用",
|
|
30
|
-
"cache_delete": "清除緩存",
|
|
31
|
-
"cache_fetch": "批量下載",
|
|
32
|
-
"cache_cancel": "停止下載",
|
|
33
|
-
"cache_processing": "正在計算...",
|
|
34
|
-
"help_title": "Maplat 幫助",
|
|
35
|
-
"help_using_maplat": "本站點是使用開源歷史地圖<a href='https://github.com/code4history/Maplat/wiki' target='_blank'>Maplat</a>為基礎製作的。",
|
|
36
|
-
"help_operation_title": "地圖的操作方法",
|
|
37
|
-
"help_operation_content": "用電腦訪問時可以用鼠標拖動地圖。使用手機訪問時用手指拖動地圖。 <br>調整地圖大小時,用電腦時,點擊左上角的<img src='${plus.png}'> <img src='${minus.png}'>按鈕來操作,使用手機時使用兩個手指縮放來進行操作。 <br>在手機上可以使用兩個手指按住旋轉地圖。 <br>按下<img src='${home.png}'>按鈕可以返回地圖的起點。 <br><img src='${compass.png}'>按鈕上表的羅盤顯示著當前方向與北方向的角度,如果按下這個按鈕,地圖的旋轉角度會恢復成正北方向表示。",
|
|
38
|
-
"help_selection_title": "地圖的切換選擇方法",
|
|
39
|
-
"help_selection_content": "在頁面的左下和右下的位置,可以找到像<img src='${overlay.png}'>這樣的可滑動的縮略圖。可以選擇想查看的地圖。 <br>左右滑動對想看的地圖進行選擇,點擊後即可切換成想看的地圖。 <br>在左下的地圖滑塊是基礎的地圖(當前年代),右下邊可選擇的地圖滑塊是手繪地圖或歷史地圖。",
|
|
40
|
-
"help_gps_title": "在地圖上顯示您的位置",
|
|
41
|
-
"help_gps_content": "按下<img src='${gps.png}'>按鈕,開啟GPS功能,可以用<img src='${bluedot.png}'>在地圖上顯示您所在的位置。 <br>再次按下時,會關閉GPS功能。 <br>如果您所在地沒有在地圖上顯示出來的話,會提示信息,並且會自動關閉GPS功能。",
|
|
42
|
-
"help_poi_title": "場所信息顯示",
|
|
43
|
-
"help_poi_content": "在地圖上顯示<img src='${defaultpin.png}'>這樣標記的地方,這個支持拓展信息顯示的地方。 <br>標記點擊時,會顯示支持的信息。",
|
|
44
|
-
"help_etc_title": "其它",
|
|
45
|
-
"help_etc_attr": "<img src='${attr.png}'>按鈕 顯示中地圖的製作者、所有者、許可等各種信息顯示。",
|
|
46
|
-
"help_etc_help": "<img src='${help.png}'>按鈕: 顯示這個幫助信息。",
|
|
47
|
-
"help_share_help": "<img src='${share.png}'>按鈕: 顯示向SNS等其它應用分享的頁面。",
|
|
48
|
-
"help_etc_hide_marker": "<img src='${hide_marker.png}'>按鈕: 顯示標記/隱藏標記 的功能切換。 <br>長按按鈕,會在畫面上按順序對每種標記進行顯示/隱藏的切換操作。",
|
|
49
|
-
"help_etc_border": "<img src='${border.png}'>按鈕: 地圖的邊界顯示。 <br>在邊界內點擊也可以切換地圖顯示。 <br>在電腦上操作可以用鼠標在地圖上上移動選擇後點擊進行地圖切換顯示,手機上在選中地圖後,再一次點擊後進行地圖切換顯示。",
|
|
50
|
-
"help_etc_slider": "<img src='${slider.png}'>側邊欄: 顯示中的地圖的透明度調整,可以將背景中的地圖透明地看到。 <br>只支持在手繪地圖、歷史地圖中使用,基本地圖顯示時不可用。",
|
|
51
|
-
"share_title": "分享",
|
|
52
|
-
"share_app_title": "分享此應用",
|
|
53
|
-
"share_state_title": "分享現在所在位置",
|
|
54
|
-
"share_copy": "複製",
|
|
55
|
-
"hide_marker_title": "標記項顯示切換"
|
|
56
|
-
},
|
|
57
|
-
"app": {
|
|
58
|
-
"fake_explanation": "※以%1$s為中心,超出%2$dkm以上時、以%1$s為中心使用模糊經緯度表示周邊範圍。",
|
|
59
|
-
"acquiring_gps_desc": "GPS數據獲取中……",
|
|
60
|
-
"out_of_map": "超出地圖範圍",
|
|
61
|
-
"out_of_map_desc": "GPS數據獲取結果已超出地圖範圍外。 GPS功能已關閉。",
|
|
62
|
-
"out_of_map_area": "已經超出地圖範圍以外。請返回地圖標準位置。",
|
|
63
|
-
"copy_toast": "已經復製到剪貼板。"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"control": {
|
|
3
|
+
"compass": "停止旋轉",
|
|
4
|
+
"info": "顯示地圖信息",
|
|
5
|
+
"zoom": "地圖尺寸調整",
|
|
6
|
+
"gps": "獲取GPS位置",
|
|
7
|
+
"home": "返回起點",
|
|
8
|
+
"help": "查看幫助",
|
|
9
|
+
"trans": "調整地圖透明度",
|
|
10
|
+
"share": "分享",
|
|
11
|
+
"hide_marker": "隱藏標記",
|
|
12
|
+
"border": "顯示地圖邊界"
|
|
13
|
+
},
|
|
14
|
+
"html": {
|
|
15
|
+
"close": "關閉",
|
|
16
|
+
"app_loading_body": "正在上傳中……",
|
|
17
|
+
"acquiring_gps": "獲取GPS數據中",
|
|
18
|
+
"author": "作者",
|
|
19
|
+
"createdAt": "創建日期",
|
|
20
|
+
"era": "對象所處時期",
|
|
21
|
+
"contributor": "收藏捐贈者",
|
|
22
|
+
"mapper": "製圖人",
|
|
23
|
+
"license": "地圖許可",
|
|
24
|
+
"dataLicense": "映射數據許可",
|
|
25
|
+
"attr": "地圖版權",
|
|
26
|
+
"dataAttr": "映射數據版權",
|
|
27
|
+
"reference": "來源參考",
|
|
28
|
+
"description": "說明",
|
|
29
|
+
"cache_handle": "地圖緩存佔用",
|
|
30
|
+
"cache_delete": "清除緩存",
|
|
31
|
+
"cache_fetch": "批量下載",
|
|
32
|
+
"cache_cancel": "停止下載",
|
|
33
|
+
"cache_processing": "正在計算...",
|
|
34
|
+
"help_title": "Maplat 幫助",
|
|
35
|
+
"help_using_maplat": "本站點是使用開源歷史地圖<a href='https://github.com/code4history/Maplat/wiki' target='_blank'>Maplat</a>為基礎製作的。",
|
|
36
|
+
"help_operation_title": "地圖的操作方法",
|
|
37
|
+
"help_operation_content": "用電腦訪問時可以用鼠標拖動地圖。使用手機訪問時用手指拖動地圖。 <br>調整地圖大小時,用電腦時,點擊左上角的<img src='${plus.png}'> <img src='${minus.png}'>按鈕來操作,使用手機時使用兩個手指縮放來進行操作。 <br>在手機上可以使用兩個手指按住旋轉地圖。 <br>按下<img src='${home.png}'>按鈕可以返回地圖的起點。 <br><img src='${compass.png}'>按鈕上表的羅盤顯示著當前方向與北方向的角度,如果按下這個按鈕,地圖的旋轉角度會恢復成正北方向表示。",
|
|
38
|
+
"help_selection_title": "地圖的切換選擇方法",
|
|
39
|
+
"help_selection_content": "在頁面的左下和右下的位置,可以找到像<img src='${overlay.png}'>這樣的可滑動的縮略圖。可以選擇想查看的地圖。 <br>左右滑動對想看的地圖進行選擇,點擊後即可切換成想看的地圖。 <br>在左下的地圖滑塊是基礎的地圖(當前年代),右下邊可選擇的地圖滑塊是手繪地圖或歷史地圖。",
|
|
40
|
+
"help_gps_title": "在地圖上顯示您的位置",
|
|
41
|
+
"help_gps_content": "按下<img src='${gps.png}'>按鈕,開啟GPS功能,可以用<img src='${bluedot.png}'>在地圖上顯示您所在的位置。 <br>再次按下時,會關閉GPS功能。 <br>如果您所在地沒有在地圖上顯示出來的話,會提示信息,並且會自動關閉GPS功能。",
|
|
42
|
+
"help_poi_title": "場所信息顯示",
|
|
43
|
+
"help_poi_content": "在地圖上顯示<img src='${defaultpin.png}'>這樣標記的地方,這個支持拓展信息顯示的地方。 <br>標記點擊時,會顯示支持的信息。",
|
|
44
|
+
"help_etc_title": "其它",
|
|
45
|
+
"help_etc_attr": "<img src='${attr.png}'>按鈕 顯示中地圖的製作者、所有者、許可等各種信息顯示。",
|
|
46
|
+
"help_etc_help": "<img src='${help.png}'>按鈕: 顯示這個幫助信息。",
|
|
47
|
+
"help_share_help": "<img src='${share.png}'>按鈕: 顯示向SNS等其它應用分享的頁面。",
|
|
48
|
+
"help_etc_hide_marker": "<img src='${hide_marker.png}'>按鈕: 顯示標記/隱藏標記 的功能切換。 <br>長按按鈕,會在畫面上按順序對每種標記進行顯示/隱藏的切換操作。",
|
|
49
|
+
"help_etc_border": "<img src='${border.png}'>按鈕: 地圖的邊界顯示。 <br>在邊界內點擊也可以切換地圖顯示。 <br>在電腦上操作可以用鼠標在地圖上上移動選擇後點擊進行地圖切換顯示,手機上在選中地圖後,再一次點擊後進行地圖切換顯示。",
|
|
50
|
+
"help_etc_slider": "<img src='${slider.png}'>側邊欄: 顯示中的地圖的透明度調整,可以將背景中的地圖透明地看到。 <br>只支持在手繪地圖、歷史地圖中使用,基本地圖顯示時不可用。",
|
|
51
|
+
"share_title": "分享",
|
|
52
|
+
"share_app_title": "分享此應用",
|
|
53
|
+
"share_state_title": "分享現在所在位置",
|
|
54
|
+
"share_copy": "複製",
|
|
55
|
+
"hide_marker_title": "標記項顯示切換"
|
|
56
|
+
},
|
|
57
|
+
"app": {
|
|
58
|
+
"fake_explanation": "※以%1$s為中心,超出%2$dkm以上時、以%1$s為中心使用模糊經緯度表示周邊範圍。",
|
|
59
|
+
"acquiring_gps_desc": "GPS數據獲取中……",
|
|
60
|
+
"out_of_map": "超出地圖範圍",
|
|
61
|
+
"out_of_map_desc": "GPS數據獲取結果已超出地圖範圍外。 GPS功能已關閉。",
|
|
62
|
+
"out_of_map_area": "已經超出地圖範圍以外。請返回地圖標準位置。",
|
|
63
|
+
"copy_toast": "已經復製到剪貼板。"
|
|
64
|
+
}
|
|
65
|
+
}
|
package/package.json
CHANGED
|
@@ -1,105 +1,106 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@maplat/ui",
|
|
3
|
-
"version": "0.10.
|
|
4
|
-
"description": "Maplat is the cool Historical Map/Illustrated Map Viewer.\nIt can transform each map coordinates with nonlinear but homeomorphic projection and makes possible that the maps can collaborate with GPS/accurate maps, without distorting original maps.",
|
|
5
|
-
"main": "src/index.js",
|
|
6
|
-
"module": "src/index.js",
|
|
7
|
-
"files": [
|
|
8
|
-
"src/",
|
|
9
|
-
"dist/",
|
|
10
|
-
"legacy/",
|
|
11
|
-
"less/",
|
|
12
|
-
"parts/",
|
|
13
|
-
"fonts/",
|
|
14
|
-
"locales/"
|
|
15
|
-
],
|
|
16
|
-
"scripts": {
|
|
17
|
-
"server": "webpack-cli serve --config ./webpack_config/webpack.config.standard.dev.js --mode=development",
|
|
18
|
-
"server:packed": "npm run freeze && webpack-cli serve --config ./webpack_config/webpack.config.packed.dev.js --mode=development",
|
|
19
|
-
"build": "npm run build:standard && npm run build:packed",
|
|
20
|
-
"build:standard": "webpack --color --progress --config ./webpack_config/webpack.config.standard.js",
|
|
21
|
-
"build:packed": "npm run freeze && webpack --config ./webpack_config/webpack.config.packed.js",
|
|
22
|
-
"zip": "gulp zip",
|
|
23
|
-
"test": "jest",
|
|
24
|
-
"preversion": "npm run lint",
|
|
25
|
-
"version": "npm run build && npm run zip && git add -A",
|
|
26
|
-
"freeze": "node bin/freezer.js",
|
|
27
|
-
"lint": "npm run lint:eslint && npm run lint:prettier",
|
|
28
|
-
"lint:eslint": "eslint \"{src,spec}/**/*.js\" --fix",
|
|
29
|
-
"lint:prettier": "prettier \"./{src,spec}/**/*.js\" --write",
|
|
30
|
-
"git_switch": "gulp git_switch"
|
|
31
|
-
},
|
|
32
|
-
"repository": {
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/code4history/Maplat.git"
|
|
35
|
-
},
|
|
36
|
-
"keywords": [
|
|
37
|
-
"warp",
|
|
38
|
-
"GIS"
|
|
39
|
-
],
|
|
40
|
-
"author": "Kohei Otsuka, Code for History",
|
|
41
|
-
"license": "Maplat Limited License 1.1",
|
|
42
|
-
"bugs": {
|
|
43
|
-
"url": "https://github.com/code4history/Maplat/issues"
|
|
44
|
-
},
|
|
45
|
-
"homepage": "https://github.com/code4history/Maplat/wiki",
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"@maplat/core": "
|
|
48
|
-
"@maplat/tin": "^0.9.4",
|
|
49
|
-
"@turf/turf": "^6.5.0",
|
|
50
|
-
"caniuse-lite": "^1.0.30001431",
|
|
51
|
-
"lodash.template": "^4.5.0",
|
|
52
|
-
"ol": "^6.14.1",
|
|
53
|
-
"ol-contextmenu": "^4.1.0",
|
|
54
|
-
"swiper": "^6.7.1",
|
|
55
|
-
"swiper4": "npm:swiper@^4.5.1",
|
|
56
|
-
"weiwudi": "^0.1.4"
|
|
57
|
-
},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"@babel/cli": "^7.17.10",
|
|
60
|
-
"@babel/core": "^7.18.2",
|
|
61
|
-
"@babel/preset-env": "^7.18.2",
|
|
62
|
-
"babel-jest": "^28.1.0",
|
|
63
|
-
"babel-loader": "^8.2.5",
|
|
64
|
-
"clean-webpack-plugin": "^4.0.0",
|
|
65
|
-
"concaveman": "https://github.com/grassick/concaveman#patch-1",
|
|
66
|
-
"copy-webpack-plugin": "^6.4.1",
|
|
67
|
-
"core-js": "^3.22.7",
|
|
68
|
-
"
|
|
69
|
-
"css-
|
|
70
|
-
"
|
|
71
|
-
"eslint
|
|
72
|
-
"eslint-
|
|
73
|
-
"eslint-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"gulp
|
|
78
|
-
"gulp-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"jest
|
|
82
|
-
"
|
|
83
|
-
"less
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"webpack
|
|
92
|
-
"webpack-
|
|
93
|
-
"
|
|
94
|
-
"workbox-
|
|
95
|
-
"workbox-
|
|
96
|
-
"workbox-
|
|
97
|
-
"workbox-
|
|
98
|
-
"workbox-
|
|
99
|
-
"workbox-
|
|
100
|
-
"workbox-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@maplat/ui",
|
|
3
|
+
"version": "0.10.6",
|
|
4
|
+
"description": "Maplat is the cool Historical Map/Illustrated Map Viewer.\nIt can transform each map coordinates with nonlinear but homeomorphic projection and makes possible that the maps can collaborate with GPS/accurate maps, without distorting original maps.",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"module": "src/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"src/",
|
|
9
|
+
"dist/",
|
|
10
|
+
"legacy/",
|
|
11
|
+
"less/",
|
|
12
|
+
"parts/",
|
|
13
|
+
"fonts/",
|
|
14
|
+
"locales/"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"server": "cross-env NODE_OPTIONS=--openssl-legacy-provider webpack-cli serve --config ./webpack_config/webpack.config.standard.dev.js --mode=development",
|
|
18
|
+
"server:packed": "cross-env NODE_OPTIONS=--openssl-legacy-provider npm run freeze && cross-env NODE_OPTIONS=--openssl-legacy-provider webpack-cli serve --config ./webpack_config/webpack.config.packed.dev.js --mode=development",
|
|
19
|
+
"build": "npm run build:standard && npm run build:packed",
|
|
20
|
+
"build:standard": "cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --color --progress --config ./webpack_config/webpack.config.standard.js",
|
|
21
|
+
"build:packed": "cross-env NODE_OPTIONS=--openssl-legacy-provider npm run freeze && cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --config ./webpack_config/webpack.config.packed.js",
|
|
22
|
+
"zip": "gulp zip",
|
|
23
|
+
"test": "jest",
|
|
24
|
+
"preversion": "npm run lint",
|
|
25
|
+
"version": "npm run build && npm run zip && git add -A",
|
|
26
|
+
"freeze": "node bin/freezer.js",
|
|
27
|
+
"lint": "npm run lint:eslint && npm run lint:prettier",
|
|
28
|
+
"lint:eslint": "eslint \"{src,spec}/**/*.js\" --fix",
|
|
29
|
+
"lint:prettier": "prettier \"./{src,spec}/**/*.js\" --write",
|
|
30
|
+
"git_switch": "gulp git_switch"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/code4history/Maplat.git"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"warp",
|
|
38
|
+
"GIS"
|
|
39
|
+
],
|
|
40
|
+
"author": "Kohei Otsuka, Code for History",
|
|
41
|
+
"license": "Maplat Limited License 1.1",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/code4history/Maplat/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/code4history/Maplat/wiki",
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@maplat/core": "https://github.com/code4history/MaplatCore#yamato_koriyama_4",
|
|
48
|
+
"@maplat/tin": "^0.9.4",
|
|
49
|
+
"@turf/turf": "^6.5.0",
|
|
50
|
+
"caniuse-lite": "^1.0.30001431",
|
|
51
|
+
"lodash.template": "^4.5.0",
|
|
52
|
+
"ol": "^6.14.1",
|
|
53
|
+
"ol-contextmenu": "^4.1.0",
|
|
54
|
+
"swiper": "^6.7.1",
|
|
55
|
+
"swiper4": "npm:swiper@^4.5.1",
|
|
56
|
+
"weiwudi": "^0.1.4"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@babel/cli": "^7.17.10",
|
|
60
|
+
"@babel/core": "^7.18.2",
|
|
61
|
+
"@babel/preset-env": "^7.18.2",
|
|
62
|
+
"babel-jest": "^28.1.0",
|
|
63
|
+
"babel-loader": "^8.2.5",
|
|
64
|
+
"clean-webpack-plugin": "^4.0.0",
|
|
65
|
+
"concaveman": "https://github.com/grassick/concaveman#patch-1",
|
|
66
|
+
"copy-webpack-plugin": "^6.4.1",
|
|
67
|
+
"core-js": "^3.22.7",
|
|
68
|
+
"cross-env": "^7.0.3",
|
|
69
|
+
"css-loader": "^5.2.6",
|
|
70
|
+
"css-minimizer-webpack-plugin": "^4.2.2",
|
|
71
|
+
"eslint": "^7.32.0",
|
|
72
|
+
"eslint-config-prettier": "^8.5.0",
|
|
73
|
+
"eslint-loader": "^4.0.2",
|
|
74
|
+
"eslint-plugin-jest": "^26.3.0",
|
|
75
|
+
"file-loader": "^6.2.0",
|
|
76
|
+
"fs-extra": "^10.1.0",
|
|
77
|
+
"gulp": "^4.0.2",
|
|
78
|
+
"gulp-cli": "^2.3.0",
|
|
79
|
+
"gulp-zip": "^5.1.0",
|
|
80
|
+
"html-webpack-plugin": "^5.5.0",
|
|
81
|
+
"jest": "^28.1.0",
|
|
82
|
+
"jest-canvas-mock": "^2.3.1",
|
|
83
|
+
"less": "^4.1.2",
|
|
84
|
+
"less-loader": "^11.0.0",
|
|
85
|
+
"lodash": "^4.17.21",
|
|
86
|
+
"mini-css-extract-plugin": "^2.6.0",
|
|
87
|
+
"prettier": "^2.6.2",
|
|
88
|
+
"strip-whitespace-loader": "github:kochizufan/strip-whitespace-loader#fix_dq_npm",
|
|
89
|
+
"terser-webpack-plugin": "^5.3.1",
|
|
90
|
+
"url-loader": "^4.1.1",
|
|
91
|
+
"webpack": "^5.72.1",
|
|
92
|
+
"webpack-cli": "^4.9.2",
|
|
93
|
+
"webpack-dev-server": "^4.11.1",
|
|
94
|
+
"workbox-build": "^6.5.4",
|
|
95
|
+
"workbox-cli": "^6.5.4",
|
|
96
|
+
"workbox-core": "^6.5.4",
|
|
97
|
+
"workbox-expiration": "^6.5.4",
|
|
98
|
+
"workbox-precaching": "^6.5.4",
|
|
99
|
+
"workbox-routing": "^6.5.4",
|
|
100
|
+
"workbox-strategies": "^6.5.4",
|
|
101
|
+
"workbox-webpack-plugin": "^6.5.4"
|
|
102
|
+
},
|
|
103
|
+
"resolutions": {
|
|
104
|
+
"concaveman": "https://github.com/grassick/concaveman#patch-1"
|
|
105
|
+
}
|
|
106
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { absoluteUrl } from "./absolute_url";
|
|
2
2
|
import { Swiper } from "./swiper_ex";
|
|
3
|
+
import { Navigation, Pagination } from "swiper";
|
|
3
4
|
import EventTarget from "ol/events/Target";
|
|
4
5
|
import page from "../legacy/page";
|
|
5
6
|
import bsn from "../legacy/bootstrap-native";
|
|
@@ -31,6 +32,7 @@ import { NowMap } from "@maplat/core/lib/source/nowmap";
|
|
|
31
32
|
import Weiwudi from "weiwudi";
|
|
32
33
|
import { normalizeArg } from "./function";
|
|
33
34
|
import pointer from "./pointer_images";
|
|
35
|
+
Swiper.use([Navigation, Pagination]);
|
|
34
36
|
|
|
35
37
|
// Maplat UI Class
|
|
36
38
|
export class MaplatUi extends EventTarget {
|
|
@@ -154,6 +156,7 @@ export class MaplatUi extends EventTarget {
|
|
|
154
156
|
const enableSplash = !ui.core.initialRestore.mapID;
|
|
155
157
|
const restoreTransparency = ui.core.initialRestore.transparency;
|
|
156
158
|
const enableOutOfMap = !appOption.presentation_mode;
|
|
159
|
+
const enablePoiHtmlNoScroll = appOption.enablePoiHtmlNoScroll;
|
|
157
160
|
|
|
158
161
|
if (appOption.enableShare) {
|
|
159
162
|
ui.core.mapDivDocument.classList.add("enable_share");
|
|
@@ -271,12 +274,21 @@ export class MaplatUi extends EventTarget {
|
|
|
271
274
|
</d>
|
|
272
275
|
|
|
273
276
|
<d c="modal_poi_content">
|
|
274
|
-
<d c="poi_web
|
|
275
|
-
|
|
277
|
+
<d c="poi_web${
|
|
278
|
+
enablePoiHtmlNoScroll
|
|
279
|
+
? ""
|
|
280
|
+
: " embed-responsive embed-responsive-60vh"
|
|
281
|
+
}">
|
|
282
|
+
<iframe c="poi_iframe iframe_poi" frameborder="0" src=""${
|
|
283
|
+
enablePoiHtmlNoScroll
|
|
284
|
+
? ` onload="window.addEventListener('message', (e) =>{if (e.data[0] == 'setHeight') {console.log(this.style.height = e.data[1]);}});" scrolling="no"`
|
|
285
|
+
: ""
|
|
286
|
+
}></iframe>
|
|
276
287
|
</d>
|
|
277
288
|
<d c="poi_data hide">
|
|
278
289
|
<d c="col-xs-12 swiper-container poi_img_swiper">
|
|
279
290
|
<d c="swiper-wrapper"></d>
|
|
291
|
+
<d c="swiper-pagination poi-pagination"></d>
|
|
280
292
|
<d c="swiper-button-next poi-img-next"></d>
|
|
281
293
|
<d c="swiper-button-prev poi-img-prev"></d>
|
|
282
294
|
</d>
|
|
@@ -1416,13 +1428,25 @@ enable-background="new 0 0 10 10" xml:space="preserve">
|
|
|
1416
1428
|
iframe.addEventListener("load", function loadEvent(event) {
|
|
1417
1429
|
event.currentTarget.removeEventListener(event.type, loadEvent);
|
|
1418
1430
|
const cssLink = createElement(
|
|
1419
|
-
'<style type="text/css">html, body { height: 100vh; }\n img { width:
|
|
1431
|
+
'<style type="text/css">html, body { height: 100vh; }\n img { width: 100%; }</style>'
|
|
1432
|
+
);
|
|
1433
|
+
const jsLink = createElement(
|
|
1434
|
+
`<script>
|
|
1435
|
+
const heightGetter = document.querySelector("#heightGetter");
|
|
1436
|
+
const resizeObserver = new ResizeObserver(entries => {
|
|
1437
|
+
window.parent.postMessage(["setHeight", (entries[0].target.clientHeight + 16) + "px"], "*");
|
|
1438
|
+
});
|
|
1439
|
+
resizeObserver.observe(heightGetter);
|
|
1440
|
+
</script>`
|
|
1420
1441
|
);
|
|
1421
|
-
console.log(cssLink); // eslint-disable-line no-undef
|
|
1422
1442
|
iframe.contentDocument.head.appendChild(cssLink[0]);
|
|
1443
|
+
iframe.contentDocument.head.appendChild(jsLink[0]);
|
|
1423
1444
|
});
|
|
1424
1445
|
iframe.removeAttribute("src");
|
|
1425
|
-
iframe.setAttribute(
|
|
1446
|
+
iframe.setAttribute(
|
|
1447
|
+
"srcdoc",
|
|
1448
|
+
`<div id="heightGetter">${this.core.translate(data.html)}</div>`
|
|
1449
|
+
);
|
|
1426
1450
|
} else {
|
|
1427
1451
|
iframe.removeAttribute("srcdoc");
|
|
1428
1452
|
iframe.setAttribute("src", this.core.translate(data.url));
|
|
@@ -1463,8 +1487,9 @@ enable-background="new 0 0 10 10" xml:space="preserve">
|
|
|
1463
1487
|
if (!this.poiSwiper) {
|
|
1464
1488
|
this.poiSwiper = new Swiper(".swiper-container.poi_img_swiper", {
|
|
1465
1489
|
lazy: true,
|
|
1490
|
+
modules: [Navigation, Pagination],
|
|
1466
1491
|
pagination: {
|
|
1467
|
-
el: ".
|
|
1492
|
+
el: ".poi-pagination",
|
|
1468
1493
|
clickable: true
|
|
1469
1494
|
},
|
|
1470
1495
|
navigation: {
|
|
@@ -1587,7 +1612,6 @@ enable-background="new 0 0 10 10" xml:space="preserve">
|
|
|
1587
1612
|
.filter(source => source.envelopeAreaIndex / areaIndex < threshold)
|
|
1588
1613
|
.sort((a, b) => a.envelopeAreaIndex - b.envelopeAreaIndex)
|
|
1589
1614
|
.map(source => source.mapID);
|
|
1590
|
-
console.log(mapIDs);
|
|
1591
1615
|
return mapIDs;
|
|
1592
1616
|
});
|
|
1593
1617
|
}
|
package/src/maplat_control.js
CHANGED
|
@@ -610,11 +610,13 @@ export class CompassRotate extends Rotate {
|
|
|
610
610
|
center[1] != this.center_[1] ||
|
|
611
611
|
zoom != this.zoom_
|
|
612
612
|
) {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
613
|
+
if (!this.getMap().northUp) {
|
|
614
|
+
const contains = this.element.classList.contains("disable");
|
|
615
|
+
if (!contains && rotation === 0) {
|
|
616
|
+
this.element.classList.add("disable");
|
|
617
|
+
} else if (contains && rotation !== 0) {
|
|
618
|
+
this.element.classList.remove("disable");
|
|
619
|
+
}
|
|
618
620
|
}
|
|
619
621
|
const self = this;
|
|
620
622
|
const layer = this.getMap().getLayers().item(0);
|
|
@@ -629,11 +631,20 @@ export class CompassRotate extends Rotate {
|
|
|
629
631
|
return;
|
|
630
632
|
}
|
|
631
633
|
source.viewpoint2MercsAsync().then(mercs => {
|
|
632
|
-
const
|
|
633
|
-
const transform = `rotate(${
|
|
634
|
+
const direction = source.mercs2MercViewpoint(mercs)[2];
|
|
635
|
+
const transform = `rotate(${direction}rad)`;
|
|
634
636
|
self.label_.style.msTransform = transform;
|
|
635
637
|
self.label_.style.webkitTransform = transform;
|
|
636
638
|
self.label_.style.transform = transform;
|
|
639
|
+
if (this.getMap().northUp) {
|
|
640
|
+
console.log(direction);
|
|
641
|
+
const contains = self.element.classList.contains("disable");
|
|
642
|
+
if (!contains && Math.abs(direction) < 0.1) {
|
|
643
|
+
self.element.classList.add("disable");
|
|
644
|
+
} else if (contains && Math.abs(direction) >= 0.1) {
|
|
645
|
+
self.element.classList.remove("disable");
|
|
646
|
+
}
|
|
647
|
+
}
|
|
637
648
|
});
|
|
638
649
|
}
|
|
639
650
|
this.rotation_ = rotation;
|
|
@@ -647,6 +658,13 @@ export class CompassRotate extends Rotate {
|
|
|
647
658
|
}
|
|
648
659
|
this.center_ = [];
|
|
649
660
|
this.zoom_ = undefined;
|
|
661
|
+
this.callResetNorth_ = () => {
|
|
662
|
+
const layer = this.getMap().getLayers().item(0);
|
|
663
|
+
const source = layer.getSource
|
|
664
|
+
? layer.getSource()
|
|
665
|
+
: layer.getLayers().item(0).getSource();
|
|
666
|
+
source.resetCirculation();
|
|
667
|
+
};
|
|
650
668
|
}
|
|
651
669
|
}
|
|
652
670
|
|
package/src/service-worker.js
CHANGED
|
@@ -26,7 +26,7 @@ clientsClaim();
|
|
|
26
26
|
* requests for URLs in the manifest.
|
|
27
27
|
* See https://goo.gl/S9QRab
|
|
28
28
|
*/
|
|
29
|
-
precacheAndRoute(self.__WB_MANIFEST
|
|
29
|
+
precacheAndRoute(self.__WB_MANIFEST);
|
|
30
30
|
// eslint-disable-next-line no-undef
|
|
31
31
|
registerRoute(
|
|
32
32
|
/(?:maps\/.+\.json|pwa\/.+|pois\/.+\.json|apps\/.+\.json|tmbs\/.+\.jpg|images\/.+\.(?:png|jpg))$/,
|