@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
@@ -0,0 +1,205 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`_getNodeFromAPI works 1`] = `
4
+ Object {
5
+ "caption": Object {
6
+ "date": Object {
7
+ "toLocaleDateString": [Function],
8
+ },
9
+ "license": "proprietary",
10
+ "producer": "User",
11
+ },
12
+ "gps": Array [
13
+ 2.1822941,
14
+ 48.9810589,
15
+ ],
16
+ "horizontalFov": 360,
17
+ "id": "0005086d-65eb-4a90-9764-86b3661aaa77",
18
+ "links": Array [
19
+ Object {
20
+ "arrowStyle": Object {
21
+ "element": <img
22
+ src="arrow_triangle.svg"
23
+ />,
24
+ "size": Object {
25
+ "height": 75,
26
+ "width": 75,
27
+ },
28
+ },
29
+ "gps": Array [
30
+ 2.1822633,
31
+ 48.9811134,
32
+ ],
33
+ "linkOffset": Object {
34
+ "yaw": -0,
35
+ },
36
+ "nodeId": "ccf5f468-38b8-4b42-8d79-b97f5391e0a3",
37
+ },
38
+ Object {
39
+ "arrowStyle": Object {
40
+ "element": <img
41
+ src="arrow_triangle.svg"
42
+ />,
43
+ "size": Object {
44
+ "height": 75,
45
+ "width": 75,
46
+ },
47
+ },
48
+ "gps": Array [
49
+ 2.1823272,
50
+ 48.9810024,
51
+ ],
52
+ "linkOffset": Object {
53
+ "yaw": -0,
54
+ },
55
+ "nodeId": "127d9282-d082-46ca-bc09-4b0d8569dd2c",
56
+ },
57
+ ],
58
+ "panorama": Object {
59
+ "basePanoData": [Function],
60
+ "baseUrl": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/sd.webp",
61
+ "cols": 8,
62
+ "hdUrl": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/hd.jpg",
63
+ "origBaseUrl": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/sd.webp",
64
+ "rows": 4,
65
+ "thumbUrl": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/thumb.jpg",
66
+ "tileUrl": [Function],
67
+ "width": 5760,
68
+ },
69
+ "properties": Object {
70
+ "datetime": "2022-05-03T13:28:56+00:00",
71
+ "license": "proprietary",
72
+ "pers:interior_orientation": Object {
73
+ "camera_manufacturer": "GoPro",
74
+ "camera_model": "Max",
75
+ "field_of_view": 360,
76
+ "focal_length": 3,
77
+ },
78
+ "tiles:tile_matrix_sets": Object {
79
+ "geovisio": Object {
80
+ "identifier": "geovisio-0005086d-65eb-4a90-9764-86b3661aaa77",
81
+ "tileMatrix": Array [
82
+ Object {
83
+ "identifier": "0",
84
+ "matrixHeight": 4,
85
+ "matrixWidth": 8,
86
+ "scaleDenominator": 1,
87
+ "tileHeight": 720,
88
+ "tileWidth": 720,
89
+ "topLeftCorner": Array [
90
+ 0,
91
+ 0,
92
+ ],
93
+ "type": "TileMatrixType",
94
+ },
95
+ ],
96
+ "title": "GeoVisio tile matrix for picture 0005086d-65eb-4a90-9764-86b3661aaa77",
97
+ "type": "TileMatrixSetType",
98
+ },
99
+ },
100
+ "view:azimuth": 0,
101
+ },
102
+ "sequence": Object {
103
+ "id": "bb129602-5ac1-4512-bf67-9ec1fa23033f",
104
+ "nextPic": "ccf5f468-38b8-4b42-8d79-b97f5391e0a3",
105
+ "prevPic": "127d9282-d082-46ca-bc09-4b0d8569dd2c",
106
+ },
107
+ "sphereCorrection": Object {
108
+ "pan": 0,
109
+ "roll": 0,
110
+ "tilt": 0,
111
+ },
112
+ }
113
+ `;
114
+
115
+ exports[`_getNodeFromAPI works with nav filter 1`] = `
116
+ Object {
117
+ "caption": Object {
118
+ "date": Object {
119
+ "toLocaleDateString": [Function],
120
+ },
121
+ "license": "proprietary",
122
+ "producer": "User",
123
+ },
124
+ "gps": Array [
125
+ 2.1822941,
126
+ 48.9810589,
127
+ ],
128
+ "horizontalFov": 360,
129
+ "id": "0005086d-65eb-4a90-9764-86b3661aaa77",
130
+ "links": Array [],
131
+ "panorama": Object {
132
+ "basePanoData": [Function],
133
+ "baseUrl": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/sd.webp",
134
+ "cols": 8,
135
+ "hdUrl": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/hd.jpg",
136
+ "origBaseUrl": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/sd.webp",
137
+ "rows": 4,
138
+ "thumbUrl": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/thumb.jpg",
139
+ "tileUrl": [Function],
140
+ "width": 5760,
141
+ },
142
+ "properties": Object {
143
+ "datetime": "2022-05-03T13:28:56+00:00",
144
+ "license": "proprietary",
145
+ "pers:interior_orientation": Object {
146
+ "camera_manufacturer": "GoPro",
147
+ "camera_model": "Max",
148
+ "field_of_view": 360,
149
+ "focal_length": 3,
150
+ },
151
+ "tiles:tile_matrix_sets": Object {
152
+ "geovisio": Object {
153
+ "identifier": "geovisio-0005086d-65eb-4a90-9764-86b3661aaa77",
154
+ "tileMatrix": Array [
155
+ Object {
156
+ "identifier": "0",
157
+ "matrixHeight": 4,
158
+ "matrixWidth": 8,
159
+ "scaleDenominator": 1,
160
+ "tileHeight": 720,
161
+ "tileWidth": 720,
162
+ "topLeftCorner": Array [
163
+ 0,
164
+ 0,
165
+ ],
166
+ "type": "TileMatrixType",
167
+ },
168
+ ],
169
+ "title": "GeoVisio tile matrix for picture 0005086d-65eb-4a90-9764-86b3661aaa77",
170
+ "type": "TileMatrixSetType",
171
+ },
172
+ },
173
+ "view:azimuth": 0,
174
+ },
175
+ "sequence": Object {
176
+ "id": "bb129602-5ac1-4512-bf67-9ec1fa23033f",
177
+ "nextPic": "ccf5f468-38b8-4b42-8d79-b97f5391e0a3",
178
+ "prevPic": "127d9282-d082-46ca-bc09-4b0d8569dd2c",
179
+ },
180
+ "sphereCorrection": Object {
181
+ "pan": 0,
182
+ "roll": 0,
183
+ "tilt": 0,
184
+ },
185
+ }
186
+ `;
187
+
188
+ exports[`clearPictureMetadataCache works when a pic is selected 1`] = `
189
+ Array [
190
+ Array [
191
+ "seq",
192
+ "pic",
193
+ ],
194
+ ]
195
+ `;
196
+
197
+ exports[`setTransitionDuration works 1`] = `
198
+ Array [
199
+ Array [
200
+ CustomEvent {
201
+ "isTrusted": false,
202
+ },
203
+ ],
204
+ ]
205
+ `;
@@ -0,0 +1,36 @@
1
+ {
2
+ "type":"FeatureCollection",
3
+ "version":"draft",
4
+ "features":[
5
+ {
6
+ "type":"Feature",
7
+ "geometry":{
8
+ "type":"Point",
9
+ "coordinates":[
10
+ 2.290084,
11
+ 49.897443
12
+ ]
13
+ },
14
+ "properties":{
15
+ "label":"8 Boulevard du Port 80000 Amiens",
16
+ "score":0.49159121588068583,
17
+ "housenumber":"8",
18
+ "id":"80021_6590_00008",
19
+ "type":"housenumber",
20
+ "name":"8 Boulevard du Port",
21
+ "postcode":"80000",
22
+ "citycode":"80021",
23
+ "x":648952.58,
24
+ "y":6977867.25,
25
+ "city":"Amiens",
26
+ "context":"80, Somme, Hauts-de-France",
27
+ "importance":0.6706612694243868,
28
+ "street":"Boulevard du Port"
29
+ }
30
+ }
31
+ ],
32
+ "attribution":"BAN",
33
+ "licence":"ODbL 1.0",
34
+ "query":"8 bd du port",
35
+ "limit":1
36
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "type": "FeatureCollection",
3
+ "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
4
+ "features": [
5
+ {
6
+ "type": "Feature",
7
+ "properties": {
8
+ "place_id": 297417241,
9
+ "osm_type": "relation",
10
+ "osm_id": 7444,
11
+ "display_name": "Paris, Île-de-France, France métropolitaine, France",
12
+ "place_rank": 15,
13
+ "category": "boundary",
14
+ "type": "administrative",
15
+ "importance": 0.9317101715588673,
16
+ "icon": "https://nominatim.openstreetmap.org/ui/mapicons/poi_boundary_administrative.p.20.png",
17
+ "address": {
18
+ "suburb": "Paris",
19
+ "city_district": "Paris",
20
+ "city": "Paris",
21
+ "ISO3166-2-lvl6": "FR-75",
22
+ "state": "Île-de-France",
23
+ "ISO3166-2-lvl4": "FR-IDF",
24
+ "region": "France métropolitaine",
25
+ "country": "France",
26
+ "country_code": "fr"
27
+ }
28
+ },
29
+ "bbox": [
30
+ 2.224122,
31
+ 48.8155755,
32
+ 2.4697602,
33
+ 48.902156
34
+ ],
35
+ "geometry": {
36
+ "type": "Polygon",
37
+ "coordinates": [
38
+ [
39
+ [
40
+ 2.224122,
41
+ 48.854199
42
+ ],
43
+ [
44
+ 2.224125,
45
+ 48.85402
46
+ ],
47
+ [
48
+ 2.224125,
49
+ 48.853869
50
+ ]
51
+ ]
52
+ ]
53
+ }
54
+ }
55
+ ]
56
+ }
@@ -0,0 +1,148 @@
1
+ {
2
+ "features": [
3
+ {
4
+ "asset_templates": {
5
+ "tiles": {
6
+ "href": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/tiled/{TileCol}_{TileRow}.jpg",
7
+ "roles": ["data"],
8
+ "type": "image/jpeg"
9
+ },
10
+ "tiles_webp": {
11
+ "href": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/tiled/{TileCol}_{TileRow}.webp",
12
+ "roles": ["data"],
13
+ "type": "image/webp"
14
+ }
15
+ },
16
+ "assets": {
17
+ "hd": {
18
+ "href": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/hd.jpg",
19
+ "roles": ["data"],
20
+ "type": "image/jpeg"
21
+ },
22
+ "hd_webp": {
23
+ "href": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/hd.webp",
24
+ "roles": ["data"],
25
+ "type": "image/webp"
26
+ },
27
+ "sd": {
28
+ "href": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/sd.jpg",
29
+ "roles": ["visual"],
30
+ "type": "image/jpeg"
31
+ },
32
+ "sd_webp": {
33
+ "href": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/sd.webp",
34
+ "roles": ["visual"],
35
+ "type": "image/webp"
36
+ },
37
+ "thumb": {
38
+ "href": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/thumb.jpg",
39
+ "roles": ["thumbnail"],
40
+ "type": "image/jpeg"
41
+ },
42
+ "thumb_webp": {
43
+ "href": "https://geovisio.fr/api/pictures/0005086d-65eb-4a90-9764-86b3661aaa77/thumb.webp",
44
+ "roles": ["thumbnail"],
45
+ "type": "image/webp"
46
+ }
47
+ },
48
+ "bbox": [2.1822941,48.9810589,2.1822941,48.9810589],
49
+ "collection": "bb129602-5ac1-4512-bf67-9ec1fa23033f",
50
+ "geometry": {
51
+ "coordinates": [2.1822941,48.9810589],
52
+ "type": "Point"
53
+ },
54
+ "id": "0005086d-65eb-4a90-9764-86b3661aaa77",
55
+ "links": [
56
+ {
57
+ "href": "https://geovisio.fr/api",
58
+ "rel": "root",
59
+ "type": "application/json"
60
+ },
61
+ {
62
+ "href": "https://geovisio.fr/api/collections/bb129602-5ac1-4512-bf67-9ec1fa23033f",
63
+ "rel": "parent",
64
+ "type": "application/json"
65
+ },
66
+ {
67
+ "href": "https://geovisio.fr/api/collections/bb129602-5ac1-4512-bf67-9ec1fa23033f/items/0005086d-65eb-4a90-9764-86b3661aaa77",
68
+ "rel": "self",
69
+ "type": "application/geo+json"
70
+ },
71
+ {
72
+ "href": "https://geovisio.fr/api/collections/bb129602-5ac1-4512-bf67-9ec1fa23033f",
73
+ "rel": "collection",
74
+ "type": "application/json"
75
+ },
76
+ {
77
+ "geometry": {
78
+ "coordinates": [2.1822633,48.9811134],
79
+ "type": "Point"
80
+ },
81
+ "href": "https://geovisio.fr/api/collections/bb129602-5ac1-4512-bf67-9ec1fa23033f/items/ccf5f468-38b8-4b42-8d79-b97f5391e0a3",
82
+ "id": "ccf5f468-38b8-4b42-8d79-b97f5391e0a3",
83
+ "rel": "next",
84
+ "type": "application/geo+json"
85
+ },
86
+ {
87
+ "geometry": {
88
+ "coordinates": [2.1823272,48.9810024],
89
+ "type": "Point"
90
+ },
91
+ "href": "https://geovisio.fr/api/collections/bb129602-5ac1-4512-bf67-9ec1fa23033f/items/127d9282-d082-46ca-bc09-4b0d8569dd2c",
92
+ "id": "127d9282-d082-46ca-bc09-4b0d8569dd2c",
93
+ "rel": "prev",
94
+ "type": "application/geo+json"
95
+ }
96
+ ],
97
+ "properties": {
98
+ "datetime": "2022-05-03T13:28:56+00:00",
99
+ "license": "proprietary",
100
+ "pers:interior_orientation": {
101
+ "camera_manufacturer": "GoPro",
102
+ "camera_model": "Max",
103
+ "field_of_view": 360,
104
+ "focal_length": 3
105
+ },
106
+ "tiles:tile_matrix_sets": {
107
+ "geovisio": {
108
+ "identifier": "geovisio-0005086d-65eb-4a90-9764-86b3661aaa77",
109
+ "tileMatrix": [
110
+ {
111
+ "identifier": "0",
112
+ "matrixHeight": 4,
113
+ "matrixWidth": 8,
114
+ "scaleDenominator": 1,
115
+ "tileHeight": 720,
116
+ "tileWidth": 720,
117
+ "topLeftCorner": [0,0],
118
+ "type": "TileMatrixType"
119
+ }
120
+ ],
121
+ "title": "GeoVisio tile matrix for picture 0005086d-65eb-4a90-9764-86b3661aaa77",
122
+ "type": "TileMatrixSetType"
123
+ }
124
+ },
125
+ "view:azimuth": 0
126
+ },
127
+ "providers": [
128
+ {
129
+ "name": "User",
130
+ "roles": ["producer"]
131
+ },
132
+ {
133
+ "name": "geovisio.fr",
134
+ "roles": ["processor","host"]
135
+ }
136
+ ],
137
+ "stac_extensions": [
138
+ "https://stac-extensions.github.io/view/v1.0.0/schema.json",
139
+ "https://raw.githubusercontent.com/stac-extensions/perspective-imagery/main/json-schema/schema.json",
140
+ "https://stac-extensions.github.io/tiled-assets/v1.0.0/schema.json"
141
+ ],
142
+ "stac_version": "1.0.0-rc.2",
143
+ "type": "Feature"
144
+ }
145
+ ],
146
+ "links": [],
147
+ "type": "FeatureCollection"
148
+ }
@@ -0,0 +1,5 @@
1
+ // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
+ // allows you to do things like:
3
+ // expect(element).toHaveTextContent(/react/i)
4
+ // learn more: https://github.com/testing-library/jest-dom
5
+ import "@testing-library/jest-dom/extend-expect";