@panoramax/web-viewer 3.0.2-develop-a8ea8e60

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.
Files changed (125) hide show
  1. package/.dockerignore +6 -0
  2. package/.gitlab-ci.yml +71 -0
  3. package/CHANGELOG.md +428 -0
  4. package/CODE_OF_CONDUCT.md +134 -0
  5. package/Dockerfile +14 -0
  6. package/LICENSE +21 -0
  7. package/README.md +39 -0
  8. package/build/editor.html +1 -0
  9. package/build/index.css +36 -0
  10. package/build/index.css.map +1 -0
  11. package/build/index.html +1 -0
  12. package/build/index.js +25 -0
  13. package/build/index.js.map +1 -0
  14. package/build/map.html +1 -0
  15. package/build/viewer.html +1 -0
  16. package/config/env.js +104 -0
  17. package/config/getHttpsConfig.js +66 -0
  18. package/config/getPackageJson.js +25 -0
  19. package/config/jest/babelTransform.js +29 -0
  20. package/config/jest/cssTransform.js +14 -0
  21. package/config/jest/fileTransform.js +40 -0
  22. package/config/modules.js +134 -0
  23. package/config/paths.js +72 -0
  24. package/config/pnpTs.js +35 -0
  25. package/config/webpack/persistentCache/createEnvironmentHash.js +9 -0
  26. package/config/webpack.config.js +885 -0
  27. package/config/webpackDevServer.config.js +127 -0
  28. package/docs/01_Start.md +149 -0
  29. package/docs/02_Usage.md +828 -0
  30. package/docs/03_URL_settings.md +140 -0
  31. package/docs/04_Advanced_examples.md +214 -0
  32. package/docs/05_Compatibility.md +85 -0
  33. package/docs/09_Develop.md +62 -0
  34. package/docs/90_Releases.md +27 -0
  35. package/docs/images/class_diagram.drawio +129 -0
  36. package/docs/images/class_diagram.jpg +0 -0
  37. package/docs/images/screenshot.jpg +0 -0
  38. package/mkdocs.yml +45 -0
  39. package/package.json +254 -0
  40. package/public/editor.html +54 -0
  41. package/public/favicon.ico +0 -0
  42. package/public/index.html +59 -0
  43. package/public/map.html +53 -0
  44. package/public/viewer.html +67 -0
  45. package/scripts/build.js +217 -0
  46. package/scripts/start.js +176 -0
  47. package/scripts/test.js +52 -0
  48. package/src/Editor.css +37 -0
  49. package/src/Editor.js +359 -0
  50. package/src/StandaloneMap.js +114 -0
  51. package/src/Viewer.css +203 -0
  52. package/src/Viewer.js +1186 -0
  53. package/src/components/CoreView.css +64 -0
  54. package/src/components/CoreView.js +159 -0
  55. package/src/components/Loader.css +56 -0
  56. package/src/components/Loader.js +111 -0
  57. package/src/components/Map.css +65 -0
  58. package/src/components/Map.js +841 -0
  59. package/src/components/Photo.css +36 -0
  60. package/src/components/Photo.js +687 -0
  61. package/src/img/arrow_360.svg +14 -0
  62. package/src/img/arrow_flat.svg +11 -0
  63. package/src/img/arrow_triangle.svg +10 -0
  64. package/src/img/arrow_turn.svg +9 -0
  65. package/src/img/bg_aerial.jpg +0 -0
  66. package/src/img/bg_streets.jpg +0 -0
  67. package/src/img/loader_base.jpg +0 -0
  68. package/src/img/loader_hd.jpg +0 -0
  69. package/src/img/logo_dead.svg +91 -0
  70. package/src/img/marker.svg +17 -0
  71. package/src/img/marker_blue.svg +20 -0
  72. package/src/img/switch_big.svg +44 -0
  73. package/src/img/switch_mini.svg +48 -0
  74. package/src/index.js +10 -0
  75. package/src/translations/de.json +163 -0
  76. package/src/translations/en.json +164 -0
  77. package/src/translations/eo.json +6 -0
  78. package/src/translations/es.json +164 -0
  79. package/src/translations/fi.json +1 -0
  80. package/src/translations/fr.json +164 -0
  81. package/src/translations/hu.json +133 -0
  82. package/src/translations/nl.json +1 -0
  83. package/src/translations/zh_Hant.json +136 -0
  84. package/src/utils/API.js +709 -0
  85. package/src/utils/Exif.js +198 -0
  86. package/src/utils/I18n.js +75 -0
  87. package/src/utils/Map.js +382 -0
  88. package/src/utils/PhotoAdapter.js +45 -0
  89. package/src/utils/Utils.js +568 -0
  90. package/src/utils/Widgets.js +477 -0
  91. package/src/viewer/URLHash.js +334 -0
  92. package/src/viewer/Widgets.css +711 -0
  93. package/src/viewer/Widgets.js +1196 -0
  94. package/tests/Editor.test.js +125 -0
  95. package/tests/StandaloneMap.test.js +44 -0
  96. package/tests/Viewer.test.js +363 -0
  97. package/tests/__snapshots__/Editor.test.js.snap +300 -0
  98. package/tests/__snapshots__/StandaloneMap.test.js.snap +30 -0
  99. package/tests/__snapshots__/Viewer.test.js.snap +195 -0
  100. package/tests/components/CoreView.test.js +91 -0
  101. package/tests/components/Loader.test.js +38 -0
  102. package/tests/components/Map.test.js +230 -0
  103. package/tests/components/Photo.test.js +335 -0
  104. package/tests/components/__snapshots__/Loader.test.js.snap +15 -0
  105. package/tests/components/__snapshots__/Map.test.js.snap +767 -0
  106. package/tests/components/__snapshots__/Photo.test.js.snap +205 -0
  107. package/tests/data/Map_geocoder_ban.json +36 -0
  108. package/tests/data/Map_geocoder_nominatim.json +56 -0
  109. package/tests/data/Viewer_pictures_1.json +148 -0
  110. package/tests/setupTests.js +5 -0
  111. package/tests/utils/API.test.js +906 -0
  112. package/tests/utils/Exif.test.js +124 -0
  113. package/tests/utils/I18n.test.js +28 -0
  114. package/tests/utils/Map.test.js +105 -0
  115. package/tests/utils/Utils.test.js +300 -0
  116. package/tests/utils/Widgets.test.js +107 -0
  117. package/tests/utils/__snapshots__/API.test.js.snap +132 -0
  118. package/tests/utils/__snapshots__/Exif.test.js.snap +43 -0
  119. package/tests/utils/__snapshots__/Map.test.js.snap +48 -0
  120. package/tests/utils/__snapshots__/Utils.test.js.snap +41 -0
  121. package/tests/utils/__snapshots__/Widgets.test.js.snap +44 -0
  122. package/tests/viewer/URLHash.test.js +537 -0
  123. package/tests/viewer/Widgets.test.js +127 -0
  124. package/tests/viewer/__snapshots__/URLHash.test.js.snap +98 -0
  125. package/tests/viewer/__snapshots__/Widgets.test.js.snap +393 -0
Binary file
package/mkdocs.yml ADDED
@@ -0,0 +1,45 @@
1
+ site_name: 'Panoramax - Web viewer'
2
+ site_url: https://docs.panoramax.fr
3
+
4
+ theme:
5
+ name: material
6
+ logo: https://gitlab.com/panoramax/gitlab-profile/-/raw/main/images/panoramax_favicon.svg
7
+ features:
8
+ - navigation.footer
9
+ - navigation.tracking
10
+ - navigation.sections
11
+ - search.suggest
12
+ - search.share
13
+ - content.code.annotate
14
+ - content.code.copy
15
+ - content.code.select
16
+
17
+ plugins:
18
+ - search
19
+
20
+ markdown_extensions:
21
+ - admonition
22
+ - pymdownx.superfences
23
+ - pymdownx.tabbed:
24
+ alternate_style: true
25
+ - pymdownx.highlight:
26
+ anchor_linenums: true
27
+ line_spans: __span
28
+ pygments_lang_class: true
29
+ - pymdownx.inlinehilite
30
+ - pymdownx.snippets
31
+ - attr_list
32
+ - pymdownx.emoji:
33
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
34
+ emoji_generator: !!python/name:material.extensions.emoji.to_svg
35
+
36
+ nav:
37
+ - 'Quick start': '01_Start.md'
38
+ - Configuration:
39
+ - 'URL settings': '03_URL_settings.md'
40
+ - 'Advanced examples': '04_Advanced_examples.md'
41
+ - Developping:
42
+ - 'Where to start': '09_Develop.md'
43
+ - 'Viewer''s API reference': '02_Usage.md'
44
+ - 'STAC API compatibility': '05_Compatibility.md'
45
+ - 'Make a release': '90_Releases.md'
package/package.json ADDED
@@ -0,0 +1,254 @@
1
+ {
2
+ "name": "@panoramax/web-viewer",
3
+ "version": "3.0.2-develop-a8ea8e60",
4
+ "description": "Panoramax web viewer for geolocated pictures",
5
+ "main": "build/index.js",
6
+ "author": "Panoramax team",
7
+ "scripts": {
8
+ "start": "node scripts/start.js",
9
+ "build": "node scripts/build.js",
10
+ "test": "node scripts/test.js",
11
+ "lint": "npx eslint --fix src/*.js src/**/*.js",
12
+ "doc": "documentation build src -f md --markdown-toc-max-depth 2 -o ./docs/02_Usage.md",
13
+ "coverage": "node scripts/test.js --coverage --watchAll=false",
14
+ "trypublish": "npm publish || true"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://gitlab.com/panoramax/clients/web-viewer"
19
+ },
20
+ "homepage": ".",
21
+ "keywords": [
22
+ "library",
23
+ "panoramax",
24
+ "pictures",
25
+ "geolocated"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "license": "MIT",
31
+ "devDependencies": {
32
+ "@babel/core": "^7.20.12",
33
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
34
+ "@svgr/webpack": "^6.5.1",
35
+ "@testing-library/jest-dom": "^5.16.5",
36
+ "@testing-library/react": "^13.4.0",
37
+ "@testing-library/user-event": "^14.4.3",
38
+ "babel-jest": "^29.4.1",
39
+ "babel-loader": "^9.1.2",
40
+ "babel-plugin-named-asset-import": "^0.3.8",
41
+ "babel-preset-react-app": "^10.0.1",
42
+ "bfj": "^7.0.2",
43
+ "browserslist": "^4.21.4",
44
+ "camelcase": "^6.2.1",
45
+ "case-sensitive-paths-webpack-plugin": "^2.4.0",
46
+ "css-loader": "^6.7.3",
47
+ "css-minimizer-webpack-plugin": "^4.2.2",
48
+ "dotenv": "^16.0.2",
49
+ "dotenv-expand": "^5.1.0",
50
+ "eslint": "^8.33.0",
51
+ "eslint-config-react-app": "^7.0.1",
52
+ "eslint-plugin-import": "^2.29.1",
53
+ "eslint-plugin-jest": "^27.2.1",
54
+ "eslint-plugin-jsdoc": "^40.0.0",
55
+ "eslint-webpack-plugin": "^3.2.0",
56
+ "file-loader": "^6.2.0",
57
+ "fs-extra": "^11.1.0",
58
+ "html-webpack-plugin": "^5.5.0",
59
+ "identity-obj-proxy": "^3.0.0",
60
+ "jest": "^27.4.3",
61
+ "jest-resolve": "^29.4.1",
62
+ "jest-watch-typeahead": "^2.1.1",
63
+ "mini-css-extract-plugin": "^2.7.2",
64
+ "postcss": "^8.4.21",
65
+ "postcss-flexbugs-fixes": "^5.0.2",
66
+ "postcss-loader": "^7.0.2",
67
+ "postcss-normalize": "^10.0.1",
68
+ "postcss-preset-env": "^8.0.1",
69
+ "prompts": "^2.4.2",
70
+ "react": "^18.2.0",
71
+ "react-app-polyfill": "^3.0.0",
72
+ "react-dev-utils": "^12.0.1",
73
+ "react-dom": "^18.2.0",
74
+ "react-refresh": "^0.14.0",
75
+ "resolve": "^1.22.1",
76
+ "resolve-url-loader": "^5.0.0",
77
+ "sass": "^1.58.0",
78
+ "sass-loader": "^13.2.0",
79
+ "semver": "^7.3.8",
80
+ "source-map-loader": "^4.0.1",
81
+ "style-loader": "^3.3.1",
82
+ "tailwindcss": "^3.2.4",
83
+ "terser-webpack-plugin": "^5.3.6",
84
+ "web-vitals": "^3.1.1",
85
+ "webpack": "^5.75.0",
86
+ "webpack-dev-server": "^4.11.1",
87
+ "webpack-manifest-plugin": "^5.0.0",
88
+ "workbox-webpack-plugin": "^6.5.4"
89
+ },
90
+ "dependencies": {
91
+ "@fortawesome/fontawesome-svg-core": "^6.4.0",
92
+ "@fortawesome/free-solid-svg-icons": "^6.4.0",
93
+ "@photo-sphere-viewer/core": "5.10.0",
94
+ "@photo-sphere-viewer/equirectangular-tiles-adapter": "5.10.0",
95
+ "@photo-sphere-viewer/gallery-plugin": "5.10.0",
96
+ "@photo-sphere-viewer/markers-plugin": "5.10.0",
97
+ "@photo-sphere-viewer/virtual-tour-plugin": "5.10.0",
98
+ "documentation": "^14.0.1",
99
+ "maplibre-gl": "^3.6.2",
100
+ "pmtiles": "^2.11.0"
101
+ },
102
+ "eslintConfig": {
103
+ "env": {
104
+ "browser": true,
105
+ "es2021": true,
106
+ "node": true,
107
+ "jest/globals": true
108
+ },
109
+ "globals": {
110
+ "__COMMIT_HASH__": true
111
+ },
112
+ "extends": "eslint:recommended",
113
+ "overrides": [
114
+ {
115
+ "files": [
116
+ "tests/*.js"
117
+ ],
118
+ "plugins": [
119
+ "jest"
120
+ ],
121
+ "extends": [
122
+ "plugin:jest/recommended"
123
+ ],
124
+ "rules": {
125
+ "jest/prefer-expect-assertions": "off"
126
+ }
127
+ }
128
+ ],
129
+ "parserOptions": {
130
+ "ecmaVersion": "latest",
131
+ "sourceType": "module"
132
+ },
133
+ "plugins": [
134
+ "jsdoc",
135
+ "jest",
136
+ "import"
137
+ ],
138
+ "rules": {
139
+ "indent": [
140
+ "error",
141
+ "tab"
142
+ ],
143
+ "linebreak-style": [
144
+ "error",
145
+ "unix"
146
+ ],
147
+ "quotes": [
148
+ "warn",
149
+ "double"
150
+ ],
151
+ "semi": [
152
+ "error",
153
+ "always"
154
+ ],
155
+ "import/no-unused-modules": [
156
+ 1,
157
+ {
158
+ "unusedExports": true,
159
+ "ignoreExports": []
160
+ }
161
+ ]
162
+ }
163
+ },
164
+ "browserslist": {
165
+ "production": [
166
+ ">0.2%",
167
+ "not dead",
168
+ "not op_mini all"
169
+ ],
170
+ "development": [
171
+ "last 1 chrome version",
172
+ "last 1 firefox version",
173
+ "last 1 safari version"
174
+ ]
175
+ },
176
+ "jest": {
177
+ "roots": [
178
+ "<rootDir>"
179
+ ],
180
+ "globals": {
181
+ "__COMMIT_HASH__": true
182
+ },
183
+ "collectCoverageFrom": [
184
+ "src/**/*.{js,jsx,ts,tsx}",
185
+ "!src/**/*.d.ts"
186
+ ],
187
+ "setupFiles": [
188
+ "react-app-polyfill/jsdom"
189
+ ],
190
+ "setupFilesAfterEnv": [],
191
+ "testMatch": [
192
+ "<rootDir>/tests/**/__tests__/**/*.{js,jsx,ts,tsx}",
193
+ "<rootDir>/tests/**/*.{spec,test}.{js,jsx,ts,tsx}"
194
+ ],
195
+ "testEnvironment": "jsdom",
196
+ "transform": {
197
+ "^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": "<rootDir>/config/jest/babelTransform.js",
198
+ "^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
199
+ "^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
200
+ },
201
+ "transformIgnorePatterns": [
202
+ "[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$",
203
+ "^.+\\.module\\.(css|sass|scss)$"
204
+ ],
205
+ "modulePaths": [],
206
+ "moduleNameMapper": {
207
+ "^react-native$": "react-native-web",
208
+ "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
209
+ "!(.*)": "$1"
210
+ },
211
+ "moduleFileExtensions": [
212
+ "web.js",
213
+ "js",
214
+ "web.ts",
215
+ "ts",
216
+ "web.tsx",
217
+ "tsx",
218
+ "json",
219
+ "web.jsx",
220
+ "jsx",
221
+ "node"
222
+ ],
223
+ "watchPlugins": [
224
+ "jest-watch-typeahead/filename",
225
+ "jest-watch-typeahead/testname"
226
+ ],
227
+ "resetMocks": true
228
+ },
229
+ "babel": {
230
+ "presets": [
231
+ [
232
+ "@babel/preset-env",
233
+ {
234
+ "loose": true
235
+ }
236
+ ],
237
+ "@babel/preset-react"
238
+ ],
239
+ "plugins": [
240
+ [
241
+ "@babel/plugin-proposal-class-properties",
242
+ {
243
+ "loose": true
244
+ }
245
+ ],
246
+ [
247
+ "@babel/plugin-proposal-private-property-in-object",
248
+ {
249
+ "loose": true
250
+ }
251
+ ]
252
+ ]
253
+ }
254
+ }
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6
+ <title>Panoramax Editor</title>
7
+ <style>
8
+ #editor {
9
+ position: relative;
10
+ width: 95%;
11
+ margin: 2.5%;
12
+ height: 400px;
13
+ }
14
+ #editor.fullpage {
15
+ position: fixed;
16
+ top: 0;
17
+ bottom: 0;
18
+ left: 0;
19
+ right: 0;
20
+ height: unset;
21
+ width: unset;
22
+ margin: 0;
23
+ }
24
+ </style>
25
+ </head>
26
+ <body>
27
+ <noscript>
28
+ You need to enable JavaScript to run this app.
29
+ </noscript>
30
+ <div id="editor" class="fullpage"></div>
31
+ <script>
32
+ var editor;
33
+ window.onload = () => {
34
+ editor = new Panoramax.Editor(
35
+ "editor",
36
+ "https://api.panoramax.xyz/api",
37
+ {
38
+ selectedSequence: "561a5056-78a4-499d-9138-26b259f0765c",
39
+ selectedPicture: "b9c51504-b25c-40da-bb47-e696b93233fc",
40
+ background: "aerial",
41
+ raster: {
42
+ type: "raster",
43
+ tiles: [
44
+ "https://wxs.ign.fr/ortho/geoportail/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ORTHOIMAGERY.ORTHOPHOTOS&TILEMATRIXSET=PM&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=image/jpeg&STYLE=normal"
45
+ ],
46
+ attribution: "&copy; IGN",
47
+ tileSize: 256
48
+ }
49
+ }
50
+ );
51
+ };
52
+ </script>
53
+ </body>
54
+ </html>
Binary file
@@ -0,0 +1,59 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6
+ <title>Panoramax JS Library</title>
7
+ <style>
8
+ body {
9
+ font-family: sans-serif;
10
+ text-align: center;
11
+ }
12
+ .allViews {
13
+ display: flex;
14
+ flex-wrap: wrap;
15
+ justify-content: space-around;
16
+ align-items: flex-start;
17
+ gap: 10px;
18
+ }
19
+ .oneView {
20
+ text-align: center;
21
+ flex-grow: 1;
22
+ flex-shrink: 1;
23
+ min-width: 30%;
24
+ }
25
+ iframe {
26
+ width: 100%;
27
+ height: 300px;
28
+ border: none;
29
+ }
30
+ </style>
31
+ </head>
32
+ <body>
33
+ <noscript>
34
+ You need to enable JavaScript to run this app.
35
+ </noscript>
36
+ <h1>Panoramax JavaScript Client</h1>
37
+ <p>Panoramax JS library offers different views to suit your needs.</p>
38
+
39
+ <div class="allViews">
40
+ <div class="oneView">
41
+ <h2 id="viewer">Viewer</h2>
42
+ <p>General-purpose map and picture display.<br /><a href="./viewer.html">Full page</a> | <a href="https://gitlab.com/panoramax/clients/web-viewer/-/blob/develop/docs/02_Usage.md#viewer">Docs</a></p>
43
+ <iframe src="./viewer.html?server=meta"></iframe>
44
+ </div>
45
+
46
+ <div class="oneView">
47
+ <h2 id="map">Standalone Map</h2>
48
+ <p>A map-only view, to locate sequences and pictures.<br /><a href="./map.html">Full page</a> | <a href="https://gitlab.com/panoramax/clients/web-viewer/-/blob/develop/docs/02_Usage.md#standalonemap">Docs</a></p>
49
+ <iframe src="./map.html"></iframe>
50
+ </div>
51
+
52
+ <div class="oneView">
53
+ <h2 id="editor">Editor</h2>
54
+ <p>A map and picture view, focused around metadata editing.<br /><a href="./editor.html">Full page</a> | <a href="https://gitlab.com/panoramax/clients/web-viewer/-/blob/develop/docs/02_Usage.md#editor">Docs</a></p>
55
+ <iframe src="./editor.html"></iframe>
56
+ </div>
57
+ </div>
58
+ </body>
59
+ </html>
@@ -0,0 +1,53 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6
+ <title>Panoramax Standalone Map</title>
7
+ <style>
8
+ #map {
9
+ position: relative;
10
+ width: 95%;
11
+ margin: 2.5%;
12
+ height: 400px;
13
+ }
14
+ #map.fullpage {
15
+ position: fixed;
16
+ top: 0;
17
+ bottom: 0;
18
+ left: 0;
19
+ right: 0;
20
+ height: unset;
21
+ width: unset;
22
+ margin: 0;
23
+ }
24
+ </style>
25
+ </head>
26
+ <body>
27
+ <noscript>
28
+ You need to enable JavaScript to run this app.
29
+ </noscript>
30
+ <div id="map" class="fullpage"></div>
31
+ <script>
32
+ var map;
33
+ window.onload = () => {
34
+ map = new Panoramax.StandaloneMap(
35
+ "map",
36
+ "https://api.panoramax.xyz/api",
37
+ );
38
+
39
+ map.addEventListener("ready", () => {
40
+ // Show in console selected seq/pic
41
+ map.addEventListener("select", e => {
42
+ console.log("Selected sequence", e.detail.seqId, "picture", e.detail.picId);
43
+ });
44
+
45
+ // Show in console hovered seq
46
+ map.addEventListener("map:sequence-hover", e => {
47
+ console.log("Hovered sequence", e.detail.seqId);
48
+ });
49
+ });
50
+ };
51
+ </script>
52
+ </body>
53
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6
+ <title>Panoramax Web Viewer</title>
7
+ <style>
8
+ #viewer {
9
+ position: relative;
10
+ width: 95%;
11
+ margin: 2.5%;
12
+ height: 400px;
13
+ }
14
+ #viewer.fullpage {
15
+ position: fixed;
16
+ top: 0;
17
+ bottom: 0;
18
+ left: 0;
19
+ right: 0;
20
+ height: unset;
21
+ width: unset;
22
+ margin: 0;
23
+ }
24
+ </style>
25
+ </head>
26
+ <body>
27
+ <noscript>
28
+ You need to enable JavaScript to run this app.
29
+ </noscript>
30
+ <div id="viewer" class="fullpage"></div>
31
+ <script>
32
+ var viewer;
33
+ var servers = {
34
+ meta: "https://api.panoramax.xyz/api",
35
+ ign: "https://panoramax.ign.fr/api",
36
+ osm: "https://panoramax.openstreetmap.fr/api",
37
+ local: "http://localhost:5000/api",
38
+ dev: "https://panoramax.codeureusesenliberte.fr/api",
39
+ };
40
+ var urlParams = new URLSearchParams(window.location.search);
41
+ var server = servers[urlParams.get("server") || "meta"];
42
+
43
+ window.onload = () => {
44
+ viewer = new Panoramax.Viewer(
45
+ "viewer",
46
+ server,
47
+ {
48
+ widgets: {
49
+ iframeBaseURL: "https://api.panoramax.xyz/"
50
+ },
51
+ map: {
52
+ startWide: true,
53
+ raster: {
54
+ type: "raster",
55
+ tiles: [
56
+ "https://wxs.ign.fr/ortho/geoportail/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ORTHOIMAGERY.ORTHOPHOTOS&TILEMATRIXSET=PM&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=image/jpeg&STYLE=normal"
57
+ ],
58
+ attribution: "&copy; IGN",
59
+ tileSize: 256
60
+ }
61
+ }
62
+ }
63
+ );
64
+ };
65
+ </script>
66
+ </body>
67
+ </html>