@panoramax/web-viewer 3.2.3-develop-d7e5a16d → 3.2.3-develop-6257391e

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 (221) hide show
  1. package/.gitlab-ci.yml +3 -0
  2. package/CHANGELOG.md +19 -0
  3. package/CODE_OF_CONDUCT.md +1 -1
  4. package/README.md +1 -1
  5. package/build/editor.html +10 -1
  6. package/build/index.css +2 -2
  7. package/build/index.css.map +1 -1
  8. package/build/index.html +1 -1
  9. package/build/index.js +1682 -5
  10. package/build/index.js.map +1 -1
  11. package/build/map.html +1 -1
  12. package/build/viewer.html +10 -1
  13. package/build/widgets.html +1 -0
  14. package/config/jest/mocks.js +172 -0
  15. package/config/paths.js +1 -0
  16. package/config/webpack.config.js +26 -0
  17. package/docs/03_URL_settings.md +3 -11
  18. package/docs/05_Compatibility.md +59 -76
  19. package/docs/09_Develop.md +30 -11
  20. package/docs/90_Releases.md +2 -2
  21. package/docs/images/class_diagram.drawio +28 -28
  22. package/docs/images/class_diagram.jpg +0 -0
  23. package/docs/index.md +112 -0
  24. package/docs/reference/components/core/Basic.md +153 -0
  25. package/docs/reference/components/core/CoverageMap.md +160 -0
  26. package/docs/reference/components/core/Editor.md +172 -0
  27. package/docs/reference/components/core/Viewer.md +288 -0
  28. package/docs/reference/components/layout/CorneredGrid.md +29 -0
  29. package/docs/reference/components/layout/Mini.md +45 -0
  30. package/docs/reference/components/menus/MapBackground.md +32 -0
  31. package/docs/reference/components/menus/MapFilters.md +15 -0
  32. package/docs/reference/components/menus/MapLayers.md +15 -0
  33. package/docs/reference/components/menus/MapLegend.md +15 -0
  34. package/docs/reference/components/menus/PictureLegend.md +15 -0
  35. package/docs/reference/components/menus/PictureMetadata.md +15 -0
  36. package/docs/reference/components/menus/PlayerOptions.md +15 -0
  37. package/docs/reference/components/menus/QualityScoreDoc.md +15 -0
  38. package/docs/reference/components/menus/ReportForm.md +15 -0
  39. package/docs/reference/components/menus/ShareMenu.md +15 -0
  40. package/docs/reference/components/ui/Button.md +39 -0
  41. package/docs/reference/components/ui/ButtonGroup.md +36 -0
  42. package/docs/reference/components/ui/CopyButton.md +35 -0
  43. package/docs/reference/components/ui/Grade.md +32 -0
  44. package/docs/reference/components/ui/LinkButton.md +44 -0
  45. package/docs/reference/components/ui/Loader.md +54 -0
  46. package/docs/reference/components/ui/Map.md +214 -0
  47. package/docs/reference/components/ui/MapMore.md +233 -0
  48. package/docs/reference/components/ui/Photo.md +369 -0
  49. package/docs/reference/components/ui/Popup.md +56 -0
  50. package/docs/reference/components/ui/QualityScore.md +45 -0
  51. package/docs/reference/components/ui/SearchBar.md +63 -0
  52. package/docs/reference/components/ui/TogglableGroup.md +39 -0
  53. package/docs/reference/components/ui/widgets/GeoSearch.md +32 -0
  54. package/docs/reference/components/ui/widgets/Legend.md +32 -0
  55. package/docs/reference/components/ui/widgets/MapFiltersButton.md +33 -0
  56. package/docs/reference/components/ui/widgets/MapLayersButton.md +15 -0
  57. package/docs/reference/components/ui/widgets/Player.md +32 -0
  58. package/docs/reference/components/ui/widgets/Share.md +15 -0
  59. package/docs/reference/components/ui/widgets/Zoom.md +15 -0
  60. package/docs/reference/utils/API.md +311 -0
  61. package/docs/reference/utils/InitParameters.md +67 -0
  62. package/docs/reference/utils/URLHandler.md +102 -0
  63. package/docs/reference.md +73 -0
  64. package/docs/shortcuts.md +11 -0
  65. package/docs/tutorials/aerial_imagery.md +19 -0
  66. package/docs/tutorials/authentication.md +10 -0
  67. package/docs/tutorials/custom_widgets.md +64 -0
  68. package/docs/tutorials/map_style.md +27 -0
  69. package/docs/tutorials/migrate_v4.md +122 -0
  70. package/docs/tutorials/synced_coverage.md +42 -0
  71. package/mkdocs.yml +60 -5
  72. package/package.json +10 -7
  73. package/public/editor.html +21 -29
  74. package/public/index.html +3 -3
  75. package/public/map.html +19 -18
  76. package/public/viewer.html +18 -24
  77. package/public/widgets.html +265 -0
  78. package/scripts/doc.js +77 -0
  79. package/src/components/core/Basic.css +44 -0
  80. package/src/components/core/Basic.js +258 -0
  81. package/src/components/core/CoverageMap.css +9 -0
  82. package/src/components/core/CoverageMap.js +105 -0
  83. package/src/components/core/Editor.css +23 -0
  84. package/src/components/core/Editor.js +354 -0
  85. package/src/components/core/Viewer.css +109 -0
  86. package/src/components/core/Viewer.js +707 -0
  87. package/src/components/core/index.js +11 -0
  88. package/src/components/index.js +13 -0
  89. package/src/components/layout/CorneredGrid.js +109 -0
  90. package/src/components/layout/Mini.js +117 -0
  91. package/src/components/layout/index.js +7 -0
  92. package/src/components/menus/MapBackground.js +106 -0
  93. package/src/components/menus/MapFilters.js +386 -0
  94. package/src/components/menus/MapLayers.js +143 -0
  95. package/src/components/menus/MapLegend.js +54 -0
  96. package/src/components/menus/PictureLegend.js +103 -0
  97. package/src/components/menus/PictureMetadata.js +188 -0
  98. package/src/components/menus/PlayerOptions.js +96 -0
  99. package/src/components/menus/QualityScoreDoc.js +36 -0
  100. package/src/components/menus/ReportForm.js +133 -0
  101. package/src/components/menus/Share.js +228 -0
  102. package/src/components/menus/index.js +15 -0
  103. package/src/components/styles.js +365 -0
  104. package/src/components/ui/Button.js +75 -0
  105. package/src/components/ui/ButtonGroup.css +49 -0
  106. package/src/components/ui/ButtonGroup.js +68 -0
  107. package/src/components/ui/CopyButton.js +71 -0
  108. package/src/components/ui/Grade.js +54 -0
  109. package/src/components/ui/LinkButton.js +68 -0
  110. package/src/components/ui/Loader.js +188 -0
  111. package/src/components/{Map.css → ui/Map.css} +5 -17
  112. package/src/components/{Map.js → ui/Map.js} +114 -138
  113. package/src/components/ui/MapMore.js +324 -0
  114. package/src/components/{Photo.css → ui/Photo.css} +6 -6
  115. package/src/components/{Photo.js → ui/Photo.js} +279 -90
  116. package/src/components/ui/Popup.js +145 -0
  117. package/src/components/ui/QualityScore.js +152 -0
  118. package/src/components/ui/SearchBar.js +363 -0
  119. package/src/components/ui/TogglableGroup.js +162 -0
  120. package/src/components/ui/index.js +20 -0
  121. package/src/components/ui/widgets/GeoSearch.css +21 -0
  122. package/src/components/ui/widgets/GeoSearch.js +139 -0
  123. package/src/components/ui/widgets/Legend.js +51 -0
  124. package/src/components/ui/widgets/MapFiltersButton.js +104 -0
  125. package/src/components/ui/widgets/MapLayersButton.js +79 -0
  126. package/src/components/ui/widgets/Player.css +7 -0
  127. package/src/components/ui/widgets/Player.js +148 -0
  128. package/src/components/ui/widgets/Share.js +30 -0
  129. package/src/components/ui/widgets/Zoom.js +82 -0
  130. package/src/components/ui/widgets/index.js +12 -0
  131. package/src/img/panoramax.svg +13 -0
  132. package/src/img/switch_big.svg +20 -10
  133. package/src/index.js +6 -9
  134. package/src/translations/da.json +1 -1
  135. package/src/translations/de.json +1 -1
  136. package/src/translations/en.json +5 -3
  137. package/src/translations/eo.json +1 -1
  138. package/src/translations/es.json +1 -1
  139. package/src/translations/fr.json +5 -3
  140. package/src/translations/hu.json +1 -1
  141. package/src/translations/it.json +1 -1
  142. package/src/translations/ja.json +1 -1
  143. package/src/translations/nl.json +1 -1
  144. package/src/translations/pl.json +1 -1
  145. package/src/translations/sv.json +1 -1
  146. package/src/translations/zh_Hant.json +1 -1
  147. package/src/utils/API.js +74 -42
  148. package/src/utils/InitParameters.js +354 -0
  149. package/src/utils/URLHandler.js +364 -0
  150. package/src/utils/geocoder.js +116 -0
  151. package/src/utils/{I18n.js → i18n.js} +3 -1
  152. package/src/utils/index.js +11 -0
  153. package/src/utils/{Map.js → map.js} +216 -80
  154. package/src/utils/picture.js +433 -0
  155. package/src/utils/utils.js +315 -0
  156. package/src/utils/widgets.js +93 -0
  157. package/tests/components/ui/CopyButton.test.js +52 -0
  158. package/tests/components/ui/Loader.test.js +54 -0
  159. package/tests/components/{Map.test.js → ui/Map.test.js} +19 -61
  160. package/tests/components/{Photo.test.js → ui/Photo.test.js} +89 -57
  161. package/tests/components/ui/Popup.test.js +24 -0
  162. package/tests/components/ui/QualityScore.test.js +17 -0
  163. package/tests/components/ui/SearchBar.test.js +107 -0
  164. package/tests/components/ui/__snapshots__/CopyButton.test.js.snap +34 -0
  165. package/tests/components/ui/__snapshots__/Loader.test.js.snap +56 -0
  166. package/tests/components/{__snapshots__ → ui/__snapshots__}/Map.test.js.snap +11 -38
  167. package/tests/components/{__snapshots__ → ui/__snapshots__}/Photo.test.js.snap +57 -4
  168. package/tests/components/ui/__snapshots__/Popup.test.js.snap +29 -0
  169. package/tests/components/ui/__snapshots__/QualityScore.test.js.snap +11 -0
  170. package/tests/components/ui/__snapshots__/SearchBar.test.js.snap +65 -0
  171. package/tests/utils/API.test.js +1 -14
  172. package/tests/utils/InitParameters.test.js +485 -0
  173. package/tests/utils/URLHandler.test.js +350 -0
  174. package/tests/utils/__snapshots__/URLHandler.test.js.snap +21 -0
  175. package/tests/utils/__snapshots__/picture.test.js.snap +315 -0
  176. package/tests/utils/__snapshots__/widgets.test.js.snap +19 -0
  177. package/tests/utils/geocoder.test.js +37 -0
  178. package/tests/utils/{I18n.test.js → i18n.test.js} +1 -1
  179. package/tests/utils/map.test.js +67 -0
  180. package/tests/utils/picture.test.js +745 -0
  181. package/tests/utils/utils.test.js +288 -0
  182. package/tests/utils/widgets.test.js +90 -0
  183. package/docs/01_Start.md +0 -149
  184. package/docs/02_Usage.md +0 -831
  185. package/docs/04_Advanced_examples.md +0 -216
  186. package/src/Editor.css +0 -37
  187. package/src/Editor.js +0 -361
  188. package/src/StandaloneMap.js +0 -114
  189. package/src/Viewer.css +0 -203
  190. package/src/Viewer.js +0 -1246
  191. package/src/components/CoreView.css +0 -70
  192. package/src/components/CoreView.js +0 -175
  193. package/src/components/Loader.css +0 -74
  194. package/src/components/Loader.js +0 -120
  195. package/src/utils/Exif.js +0 -193
  196. package/src/utils/Utils.js +0 -631
  197. package/src/utils/Widgets.js +0 -562
  198. package/src/viewer/URLHash.js +0 -469
  199. package/src/viewer/Widgets.css +0 -880
  200. package/src/viewer/Widgets.js +0 -1470
  201. package/tests/Editor.test.js +0 -126
  202. package/tests/StandaloneMap.test.js +0 -45
  203. package/tests/Viewer.test.js +0 -366
  204. package/tests/__snapshots__/Editor.test.js.snap +0 -298
  205. package/tests/__snapshots__/StandaloneMap.test.js.snap +0 -30
  206. package/tests/__snapshots__/Viewer.test.js.snap +0 -195
  207. package/tests/components/CoreView.test.js +0 -92
  208. package/tests/components/Loader.test.js +0 -38
  209. package/tests/components/__snapshots__/Loader.test.js.snap +0 -15
  210. package/tests/utils/Exif.test.js +0 -124
  211. package/tests/utils/Map.test.js +0 -113
  212. package/tests/utils/Utils.test.js +0 -300
  213. package/tests/utils/Widgets.test.js +0 -107
  214. package/tests/utils/__snapshots__/Exif.test.js.snap +0 -43
  215. package/tests/utils/__snapshots__/Utils.test.js.snap +0 -41
  216. package/tests/utils/__snapshots__/Widgets.test.js.snap +0 -44
  217. package/tests/viewer/URLHash.test.js +0 -559
  218. package/tests/viewer/Widgets.test.js +0 -127
  219. package/tests/viewer/__snapshots__/URLHash.test.js.snap +0 -108
  220. package/tests/viewer/__snapshots__/Widgets.test.js.snap +0 -403
  221. /package/tests/utils/__snapshots__/{Map.test.js.snap → geocoder.test.js.snap} +0 -0
@@ -0,0 +1,67 @@
1
+ <a name="Panoramax.utils.InitParameters"></a>
2
+
3
+ ## Panoramax.utils.InitParameters
4
+ **Kind**: static class of <code>Panoramax.utils</code>
5
+
6
+ * [.InitParameters](#Panoramax.utils.InitParameters)
7
+ * [new InitParameters([componentAttrs], [urlParams])](#new_Panoramax.utils.InitParameters_new)
8
+ * [.getParentInit()](#Panoramax.utils.InitParameters+getParentInit)
9
+ * [.getParentPostInit()](#Panoramax.utils.InitParameters+getParentPostInit)
10
+ * [.getPSVInit()](#Panoramax.utils.InitParameters+getPSVInit)
11
+ * [.getPSVPostInit()](#Panoramax.utils.InitParameters+getPSVPostInit)
12
+ * [.getMapInit()](#Panoramax.utils.InitParameters+getMapInit)
13
+ * [.getMapPostInit()](#Panoramax.utils.InitParameters+getMapPostInit)
14
+
15
+ <a name="new_Panoramax.utils.InitParameters_new"></a>
16
+
17
+ ### new InitParameters([componentAttrs], [urlParams])
18
+ Merges all URL parameters and component attributes into a single set of coherent settings.
19
+
20
+
21
+ | Param | Type | Description |
22
+ | --- | --- | --- |
23
+ | [componentAttrs] | <code>object</code> | HTML attributes from parent component |
24
+ | [urlParams] | <code>object</code> | Parameters extracted from URL |
25
+
26
+ <a name="Panoramax.utils.InitParameters+getParentInit"></a>
27
+
28
+ ### initParameters.getParentInit()
29
+ Get core component initialization parameters.
30
+ They must be passed as soon as possible.
31
+
32
+ **Kind**: instance method of [<code>InitParameters</code>](#Panoramax.utils.InitParameters)
33
+ <a name="Panoramax.utils.InitParameters+getParentPostInit"></a>
34
+
35
+ ### initParameters.getParentPostInit()
36
+ Get core component post-initialization parameters.
37
+ They must be passed after first rendering or init.
38
+
39
+ **Kind**: instance method of [<code>InitParameters</code>](#Panoramax.utils.InitParameters)
40
+ <a name="Panoramax.utils.InitParameters+getPSVInit"></a>
41
+
42
+ ### initParameters.getPSVInit()
43
+ Get Photo Sphere Viewer initialization parameters.
44
+ They must be passed as soon as possible.
45
+
46
+ **Kind**: instance method of [<code>InitParameters</code>](#Panoramax.utils.InitParameters)
47
+ <a name="Panoramax.utils.InitParameters+getPSVPostInit"></a>
48
+
49
+ ### initParameters.getPSVPostInit()
50
+ Get Photo Sphere Viewer post-initialization parameters.
51
+ They must be passed after first rendering or init.
52
+
53
+ **Kind**: instance method of [<code>InitParameters</code>](#Panoramax.utils.InitParameters)
54
+ <a name="Panoramax.utils.InitParameters+getMapInit"></a>
55
+
56
+ ### initParameters.getMapInit()
57
+ Get MapLibre GL initialization parameters.
58
+ They must be passed as soon as possible.
59
+
60
+ **Kind**: instance method of [<code>InitParameters</code>](#Panoramax.utils.InitParameters)
61
+ <a name="Panoramax.utils.InitParameters+getMapPostInit"></a>
62
+
63
+ ### initParameters.getMapPostInit()
64
+ Get MapLibre GL post-initialization parameters.
65
+ They must be passed after first rendering or init.
66
+
67
+ **Kind**: instance method of [<code>InitParameters</code>](#Panoramax.utils.InitParameters)
@@ -0,0 +1,102 @@
1
+ <a name="Panoramax.utils.URLHandler"></a>
2
+
3
+ ## Panoramax.utils.URLHandler
4
+ **Kind**: static class of <code>Panoramax.utils</code>
5
+ **Emits**: [<code>url-changed</code>](#Panoramax.utils.URLHandler+event_url-changed)
6
+
7
+ * [.URLHandler](#Panoramax.utils.URLHandler)
8
+ * [new URLHandler(parent)](#new_Panoramax.utils.URLHandler_new)
9
+ * [.listenToChanges()](#Panoramax.utils.URLHandler+listenToChanges)
10
+ * [.nextURLParams()](#Panoramax.utils.URLHandler+nextURLParams) ⇒ <code>object</code>
11
+ * [.nextURLString()](#Panoramax.utils.URLHandler+nextURLString) ⇒ <code>string</code>
12
+ * [.currentURLParams()](#Panoramax.utils.URLHandler+currentURLParams) ⇒ <code>object</code>
13
+ * [.currentMapString()](#Panoramax.utils.URLHandler+currentMapString) ⇒ <code>string</code>
14
+ * [.currentPSVString()](#Panoramax.utils.URLHandler+currentPSVString) ⇒ <code>string</code>
15
+ * [.nextShortLink()](#Panoramax.utils.URLHandler+nextShortLink) ⇒ <code>str</code>
16
+ * [.getUnmanagedParameters(prevUrl)](#Panoramax.utils.URLHandler+getUnmanagedParameters)
17
+ * ["url-changed"](#Panoramax.utils.URLHandler+event_url-changed)
18
+
19
+ <a name="new_Panoramax.utils.URLHandler_new"></a>
20
+
21
+ ### new URLHandler(parent)
22
+ Updates the URL query part with various parent component information.
23
+
24
+ Note that you may call `listenToChanges()` for this class to be effective once parent is ready-enough.
25
+
26
+
27
+ | Param | Type | Description |
28
+ | --- | --- | --- |
29
+ | parent | [<code>Basic</code>](../components/core/Basic.md/#Panoramax.components.core.Basic) | The parent component |
30
+
31
+ <a name="Panoramax.utils.URLHandler+listenToChanges"></a>
32
+
33
+ ### urlHandler.listenToChanges()
34
+ Start listening to URL & parent changes through events.
35
+ This leads to parent & URL updates.
36
+
37
+ **Kind**: instance method of [<code>URLHandler</code>](#Panoramax.utils.URLHandler)
38
+ <a name="Panoramax.utils.URLHandler+nextURLParams"></a>
39
+
40
+ ### urlHandler.nextURLParams() ⇒ <code>object</code>
41
+ Compute next values to insert in URL
42
+
43
+ **Kind**: instance method of [<code>URLHandler</code>](#Panoramax.utils.URLHandler)
44
+ **Returns**: <code>object</code> - Query parameters
45
+ <a name="Panoramax.utils.URLHandler+nextURLString"></a>
46
+
47
+ ### urlHandler.nextURLString() ⇒ <code>string</code>
48
+ Compute next URL query string (based on `nextURLParams()`)
49
+
50
+ **Kind**: instance method of [<code>URLHandler</code>](#Panoramax.utils.URLHandler)
51
+ **Returns**: <code>string</code> - The query string
52
+ <a name="Panoramax.utils.URLHandler+currentURLParams"></a>
53
+
54
+ ### urlHandler.currentURLParams() ⇒ <code>object</code>
55
+ Transforms current URL query string into key->value object
56
+
57
+ **Kind**: instance method of [<code>URLHandler</code>](#Panoramax.utils.URLHandler)
58
+ **Returns**: <code>object</code> - Key-value read from current URL query
59
+ <a name="Panoramax.utils.URLHandler+currentMapString"></a>
60
+
61
+ ### urlHandler.currentMapString() ⇒ <code>string</code>
62
+ Get string representation of map position
63
+
64
+ **Kind**: instance method of [<code>URLHandler</code>](#Panoramax.utils.URLHandler)
65
+ **Returns**: <code>string</code> - zoom/lat/lon or zoom/lat/lon/bearing/pitch
66
+ <a name="Panoramax.utils.URLHandler+currentPSVString"></a>
67
+
68
+ ### urlHandler.currentPSVString() ⇒ <code>string</code>
69
+ Get PSV view position as string
70
+
71
+ **Kind**: instance method of [<code>URLHandler</code>](#Panoramax.utils.URLHandler)
72
+ **Returns**: <code>string</code> - x/y/z
73
+ <a name="Panoramax.utils.URLHandler+nextShortLink"></a>
74
+
75
+ ### urlHandler.nextShortLink() ⇒ <code>str</code>
76
+ Get short link URL (query replaced by Base64)
77
+
78
+ **Kind**: instance method of [<code>URLHandler</code>](#Panoramax.utils.URLHandler)
79
+ **Returns**: <code>str</code> - The short link URL
80
+ <a name="Panoramax.utils.URLHandler+getUnmanagedParameters"></a>
81
+
82
+ ### urlHandler.getUnmanagedParameters(prevUrl)
83
+ Returns a string containing only parameters out of URLHandler scope
84
+
85
+ **Kind**: instance method of [<code>URLHandler</code>](#Panoramax.utils.URLHandler)
86
+
87
+ | Param | Type | Description |
88
+ | --- | --- | --- |
89
+ | prevUrl | <code>URL</code> | The previously set URL |
90
+
91
+ <a name="Panoramax.utils.URLHandler+event_url-changed"></a>
92
+
93
+ ### "url-changed"
94
+ URL changed event
95
+
96
+ **Kind**: event emitted by [<code>URLHandler</code>](#Panoramax.utils.URLHandler)
97
+ **Properties**
98
+
99
+ | Name | Type | Description |
100
+ | --- | --- | --- |
101
+ | detail.url | <code>string</code> | The new used URL |
102
+
@@ -0,0 +1,73 @@
1
+ # API reference overview
2
+
3
+ All of components and classes are grouped in the imported library named `Panoramax`.
4
+
5
+ ## `components.core`
6
+
7
+ Main web components:
8
+
9
+ - [Basic](./reference/components/core/Basic.md) : base class for other components, embedding shared logic.
10
+ - [CoverageMap](./reference/components/core/CoverageMap.md) : map showing Panoramax data availability.
11
+ - [Editor](./reference/components/core/Editor.md) : photo and map display for editing purposes.
12
+ - [Viewer](./reference/components/core/Viewer.md) : the classic photo and map viewer.
13
+
14
+ ## `components.layout`
15
+
16
+ Layout helpers:
17
+
18
+ - [CorneredGrid](./reference/components/layout/CorneredGrid.md) : corner-oriented layout over a background component.
19
+ - [Mini](./reference/components/layout/Mini.md) : reduced and collapsable mini component.
20
+
21
+ ## `components.menus`
22
+
23
+ All-in-one, ready-to-use menus for complex operations. Note that they don't embed a container (like popup or panel) to be reusable in any situation.
24
+
25
+ - [MapBackground](./reference/components/menus/MapBackground.md) : change map background.
26
+ - [MapFilters](./reference/components/menus/MapFilters.md) : set map filters.
27
+ - [MapLayers](./reference/components/menus/MapLayers.md) : change map theme and background.
28
+ - [MapLegend](./reference/components/menus/MapLegend.md) : display map sources and Panoramax info.
29
+ - [PictureLegend](./reference/components/menus/PictureLegend.md) : display date, author and info for a picture.
30
+ - [PictureMetadata](./reference/components/menus/PictureMetadata.md) : display full details about a picture.
31
+ - [PlayerOptions](./reference/components/menus/PlayerOptions.md) : speed and constrast settings for play sequence feature.
32
+ - [QualityScoreDoc](./reference/components/menus/QualityScoreDoc.md) : details about quality score computation.
33
+ - [ReportForm](./reference/components/menus/ReportForm.md) : picture issue reporting form.
34
+ - [ShareMenu](./reference/components/menus/ShareMenu.md) : links and iframe sharing.
35
+
36
+ ## `components.ui`
37
+
38
+ Basic UI components:
39
+
40
+ - [Button](./reference/components/ui/Button.md) : a simple button.
41
+ - [ButtonGroup](./reference/components/ui/ButtonGroup.md) : button bar.
42
+ - [CopyButton](./reference/components/ui/CopyButton.md) : a copy-to-clipboard button.
43
+ - [Grade](./reference/components/ui/Grade.md) : a 5-star rating display.
44
+ - [LinkButton](./reference/components/ui/LinkButton.md) : a link button/
45
+ - [Loader](./reference/components/ui/Loader.md) : the fullscreen initial loader.
46
+ - [Map](./reference/components/ui/Map.md) : the browseable map (MapLibre GL).
47
+ - [MapMore](./reference/components/ui/MapMore.md) : advanced version of the browseable map.
48
+ - [Photo](./reference/components/ui/Photo.md) : the picture display (Photo Sphere Viewer).
49
+ - [Popup](./reference/components/ui/Popup.md) : an overlaying popup/modal.
50
+ - [QualityScore](./reference/components/ui/QualityScore.md) : a A/B/C/D/E grade display and input.
51
+ - [SearchBar](./reference/components/ui/SearchBar.md) : a search bar.
52
+ - [TogglableGroup](./reference/components/ui/TogglableGroup.md) : an helper for showing a menu on button click.
53
+
54
+
55
+ ## `components.ui.widgets`
56
+
57
+ More complex UI components (but not menus):
58
+
59
+ - [GeoSearch](./reference/components/ui/widgets/GeoSearch.md) : a geocoder search bar with GPS location tool.
60
+ - [Legend](./reference/components/ui/widgets/Legend.md) : a togglable map/picture legend.
61
+ - [MapFiltersButton](./reference/components/ui/widgets/MapFiltersButton.md) : a togglable map filters button & menu.
62
+ - [MapLayersButton](./reference/components/ui/widgets/MapLayersButton.md) : a togglable map layers button & menu.
63
+ - [Player](./reference/components/ui/widgets/Player.md) : the previous/next/play/pause toolbar.
64
+ - [Share](./reference/components/ui/widgets/Share.md) : a togglable share button & menu.
65
+ - [Zoom](./reference/components/ui/widgets/Zoom.md) : the +/- zoom toolbar.
66
+
67
+ ## `utils`
68
+
69
+ General helpers outside of single component scope:
70
+
71
+ - [API](./reference/utils/API.md) : the Panoramax API helper (many get & post HTTP helpers).
72
+ - [InitParameters](./reference/utils/InitParameters.md) : helper for merging URL and component parameters.
73
+ - [URLHandler](./reference/utils/URLHandler.md) : the window URL manager (changes query part).
@@ -0,0 +1,11 @@
1
+ # Keyboard shortcuts
2
+
3
+ All interactions with the viewer can be done using the mouse, and some can be also done using keyboard.
4
+
5
+ * __Arrows__ (or 2/4/8/6 on keypad): move inside the picture, or move the map
6
+ * __Page up/down__ (or 3/9 on keypad) : go to next or previous picture in sequence
7
+ * __+ / -__ : zoom picture or map in or out
8
+ * __*__ (or 5 on keypad) : move picture or map to its center
9
+ * __Home / ↖️__ (or 7 on keypad) : switch map and picture as main shown component
10
+ * __End__ (or 1 on keypad) : hide minimized map or picture
11
+ * __Space__ : play or pause current sequence
@@ -0,0 +1,19 @@
1
+ # Adding aerial imagery
2
+
3
+ In complement of classic _streets_ rendering, you can add an aerial imagery as map background. This is possible using a WMS or WMTS service, and setting configuration as following (this example uses the French IGN aerial imagery):
4
+
5
+ ```html
6
+ <pnx-viewer
7
+ endpoint="https://panoramax.ign.fr/api"
8
+ map='{"raster": {
9
+ "type": "raster",
10
+ "tiles": [
11
+ "https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ORTHOIMAGERY.ORTHOPHOTOS&STYLE=normal&FORMAT=image/jpeg&TILEMATRIXSET=PM_0_21&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}"
12
+ ],
13
+ "minzoom": 0,
14
+ "maxzoom": 21,
15
+ "attribution": "&copy; IGN",
16
+ "tileSize": 256
17
+ }}'
18
+ />
19
+ ```
@@ -0,0 +1,10 @@
1
+ # Authentication against API
2
+
3
+ If the STAC API you're using needs some kind of authentication, you can pass it through any core component options. Parameter `fetchOptions` allows you to set custom parameters for the [JS fetch function](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters), like the `credentials` setting. For example:
4
+
5
+ ```html
6
+ <pnx-viewer
7
+ endpoint="https://your-secured-stac.fr/api"
8
+ fetchOptions='{ "credentials": "include" }'
9
+ />
10
+ ```
@@ -0,0 +1,64 @@
1
+ # Manage custom widgets
2
+
3
+ The viewer allows you to manage finely its widgets, you can either add or replace all widgets offered by the viewer.
4
+
5
+ We use internally [slots](https://developer.mozilla.org/docs/Web/HTML/Element/slot) to make this possible. Each corner of the viewer is identified uniquely, so you can add in the exact place you'd like. This is in a similar fashion to MapLibre GL or Leaflet widgets management.
6
+
7
+ !!! note
8
+
9
+ This is only available for __Viewer__ component, not for _Coverage Map_ or _Editor_.
10
+
11
+
12
+ ## Add a new widget
13
+
14
+ Let's say you want to add a custom widget without removing existing viewer ones. You can insert your element inside of the viewer markup:
15
+
16
+ ```html
17
+ <pnx-viewer
18
+ endpoint="https://panoramax.openstreetmap.fr/"
19
+ >
20
+ <p slot="top-right">My custom text</p>
21
+ </pnx-viewer>
22
+ ```
23
+
24
+ The magic happens here thanks to the `slop="top-right"` attribute on your element. You can use any corner you like (`top-left`, `top`, `top-right`, `bottom-left`, `bottom`, `bottom-right`), and add several elements on a same corner (they will stack depending of existing CSS styles).
25
+
26
+ ## Replace all widgets
27
+
28
+ For finer control, you may want to get rid of all existing widgets before adding your own ones. This is also possible by setting `widgets="false"` attribute on the viewer:
29
+
30
+ ```html
31
+ <pnx-viewer
32
+ endpoint="https://panoramax.openstreetmap.fr/"
33
+ widgets="false"
34
+ >
35
+ <p slot="top-right">My custom text</p>
36
+ </pnx-viewer>
37
+ ```
38
+
39
+ Note that this keeps only the _Mini_ map/picture display (in bottom-left corner), if you want to get rid of it as well, you can with `map="false"` attribute:
40
+
41
+ ```html
42
+ <pnx-viewer
43
+ endpoint="https://panoramax.openstreetmap.fr/"
44
+ widgets="false"
45
+ map="false"
46
+ >
47
+ <p slot="top-right">My custom text</p>
48
+ </pnx-viewer>
49
+ ```
50
+
51
+ ## Reuse default widgets
52
+
53
+ You may also want to reuse differently existing widgets. Note that all of them are listed in the [API reference](../reference.md). Just insert them as slotted components inside the viewer:
54
+
55
+ ```html
56
+ <pnx-viewer
57
+ endpoint="https://panoramax.openstreetmap.fr/"
58
+ widgets="false"
59
+ >
60
+ <pnx-widget-zoom slot="top-right" />
61
+ </pnx-viewer>
62
+ ```
63
+
64
+ Note that parent variables (`_parent` and `_t`) are automatically passed through by the viewer, no need to add it manually.
@@ -0,0 +1,27 @@
1
+ # Change map background style
2
+
3
+ All components can be configured to use a different map background than the default one. By default, an OpenStreetMap France classic style if offered. Changing the style is done by passing a `style` parameter on viewer setup. It should follow the [MapLibre Style specification](https://maplibre.org/maplibre-style-spec) and be passed as an object, or an URL to such style:
4
+
5
+ ```html
6
+ <pnx-viewer
7
+ endpoint="https://api.panoramax.xyz/api"
8
+ style="https://my.tiles.provider/basic.json"
9
+ />
10
+ ```
11
+
12
+ Note that we also support PMTiles (for a simpler tile hosting), so your style file can contain vector source defined like this:
13
+
14
+ ```html
15
+ <pnx-viewer
16
+ endpoint="https://api.panoramax.xyz/api"
17
+ style='{
18
+ "sources": {
19
+ "protomaps": {
20
+ "type": "vector",
21
+ "url": "pmtiles://https://example.com/example.pmtiles",
22
+ }
23
+ }
24
+ ...
25
+ }'
26
+ />
27
+ ```
@@ -0,0 +1,122 @@
1
+ # Migration from v3 to v4
2
+
3
+ The version 4 of _Panoramax Web Viewer_ has seen major changes, migrating from custom code to Web Components. This requires you to change a few things compared to version 3.
4
+
5
+ !!! note
6
+
7
+ If at some point you're lost or need help, you can contact us through [issues](https://gitlab.com/panoramax/clients/web-viewer/-/issues) or by [email](mailto:panoramax@panoramax.fr).
8
+
9
+ ## 🪄 Initializing components
10
+
11
+ The way you create a component (viewer, editor, coverage map) is different :
12
+
13
+ === "v4"
14
+
15
+ Now, you have to create a HTML-like component and pass attributes.
16
+
17
+ ```html
18
+ <pnx-viewer id="myviewer" endpoint="https://api.panoramax.xyz/api" />
19
+ ```
20
+
21
+ You can then access it in JS to manage it.
22
+
23
+ ```js
24
+ let myviewer = document.getElementById("myviewer");
25
+ ```
26
+
27
+ === "v3"
28
+
29
+ Before, you created a `div` with ID, then passed it to JS class.
30
+
31
+ ```js
32
+ let myViewer = new Panoramax.Viewer("viewer", "https://api.panoramax.xyz/api");
33
+ ```
34
+
35
+ ## ⏯️ Widgets options
36
+
37
+ Viewer widgets options are managed quite differently in version 4:
38
+
39
+ - You can disable all widgets with `widgets="false" map="false"` options
40
+ - You can add or replace widgets using web component slots (insert your own widgets as child of viewer)
41
+
42
+ This allows to do things like:
43
+
44
+ ```html
45
+ <pnx-viewer
46
+ endpoint="https://panoramax.openstreetmap.fr/"
47
+ widgets="false"
48
+ >
49
+ <p slot="top-right">My custom text</p>
50
+ </pnx-viewer>
51
+ ```
52
+
53
+ This offers more flexibility, check out [how to manage custom widgets in dedicated documentation](./custom_widgets.md).
54
+
55
+ ## 🏷️ Class & packages names
56
+
57
+ Many stuff was moved around, and have a bit different naming. Main classes should be called directly by their web component name:
58
+
59
+ | v3 class | v4 web component |
60
+ |----------|------------------|
61
+ | `Panoramax.Viewer` | `<pnx-viewer>` |
62
+ | `Panoramax.Editor` | `<pnx-editor>` |
63
+ | `Panoramax.StandaloneMap` | `<pnx-coverage-map>` |
64
+
65
+ And source code is splitted in more packages:
66
+
67
+ * `Panoramax.components` : everything you can see graphically
68
+ * `.core` : Viewer, Editor, Coverage Map and Basic (common code)
69
+ * `.layout` : helper classes for layout
70
+ * `.menus` : complex menus (map filters, picture metadata...)
71
+ * `.ui` : re-usable small graphical components
72
+ * `.ui.widgets` : specialized small graphical components (button + menu, extended search bar...)
73
+ * `Panoramax.utils` : helper classes and functions
74
+
75
+ ## 👂 Events
76
+
77
+ Many events names were changed, and some of them moved to sub-components.
78
+
79
+ | v3 class | v3 event name | v4 class | v4 event name |
80
+ |----------|-----------------------------------|------------------------|---------------|
81
+ | CoreView | `map:background-changed` | components.ui.Map | `background-changed` |
82
+ | CoreView | `map:picture-click` | components.ui.Map | `picture-click` |
83
+ | CoreView | `map:sequence-hover` | components.ui.Map | `sequence-hover` |
84
+ | CoreView | `map:sequence-click` | components.ui.Map | `sequence-click` |
85
+ | CoreView | `map:users-changed` | components.ui.Map | `users-changed` |
86
+ | CoreView | `psv:picture-loaded` | components.ui.Photo | `picture-loaded` |
87
+ | CoreView | `psv:picture-loading` | components.ui.Photo | `picture-loading` |
88
+ | CoreView | `psv:picture-preview-started` | components.ui.Photo | `picture-preview-started` |
89
+ | CoreView | `psv:picture-preview-stopped` | components.ui.Photo | `picture-preview-stopped` |
90
+ | CoreView | `psv:picture-tiles-loaded` | components.ui.Photo | `picture-tiles-loaded` |
91
+ | CoreView | `psv:view-rotated` | components.ui.Photo | `view-rotated` |
92
+ | CoreView | `psv:transition-duration-changed` | components.ui.Photo | `transition-duration-changed` |
93
+ | Viewer | `filters-changed` | components.ui.MapMore | `filters-changed` |
94
+ | Viewer | `focus-changed` | components.core.Viewer | `focus-changed` |
95
+ | Viewer | `josm-live-enabled` | ❌ Removed | |
96
+ | Viewer | `josm-live-disabled` | ❌ Removed | |
97
+ | Viewer | `pictures-navigation-changed` | components.ui.Photo | `pictures-navigation-changed` |
98
+ | Viewer | `sequence-playing` | components.ui.Photo | `sequence-playing` |
99
+ | Viewer | `sequence-stopped` | components.ui.Photo | `sequence-stopped` |
100
+
101
+ To listen to these events, you have to use `map` and `psv` properties of your component.
102
+
103
+ ```js
104
+ myviewer.addEventListener("focus-changed", e => console.log(e));
105
+ myviewer.psv.addEventListener("sequence-playing", e => console.log(e));
106
+
107
+ // Note that MapLibre uses on/once functions for events
108
+ myviewer.map.on("picture-click", e => console.log(e));
109
+ ```
110
+
111
+ ## ⚙️ Functions
112
+
113
+ Many functions were changed as well, in order to reduce source files size and make things more logical. You can find [all API reference in this doc](../reference.md), here's a summary:
114
+
115
+ | v3 | v4 |
116
+ |---------------------|---------------------|
117
+ | `Viewer.refreshPSV` | `(components.ui).Photo.forceRefresh` |
118
+ | `Viewer`'s play/stop/toggle sequence | Gone to `(components.ui).Photo` |
119
+ | `Viewer`'s get/set pictures navigation | Gone to `(components.ui).Photo` |
120
+ | `Viewer.toggleJOSMLive` | Made private in `(components.ui.widgets).Share` |
121
+ | `Viewer`'s set/toggle focus/unfocused | Managed through `(components.core).Viewer` `focus` attribute and `mini` property |
122
+ | `Viewer.setFilters` | `(components.ui).MapMore` |
@@ -0,0 +1,42 @@
1
+ # Coverage map synced with external component
2
+
3
+ Let's say you want to list all sequences of an user. You can display a standalone map which can be synced with your custom list. Create your _Coverage Map_ web component:
4
+
5
+ ```html
6
+ <pnx-coverage-map
7
+ id="coverage"
8
+ class="fullpage"
9
+ endpoint="https://api.panoramax.xyz/api"
10
+ />
11
+ ```
12
+
13
+ Then, access it through JavaScript for further interaction:
14
+
15
+ ```js
16
+ // Retrieve component from DOM
17
+ var coverage = document.getElementById("coverage");
18
+
19
+ // Wait for map initial load
20
+ coverage.addEventListener("ready", () => {
21
+ // Change visible map area
22
+ coverage.map.fitBounds([0, 0, 180, 90]);
23
+
24
+ // Listen to sequence hovered on map
25
+ coverage.map.on("sequence-hover", e => {
26
+ console.log("Hovered sequence", e.seqId);
27
+ });
28
+
29
+ // Listen to user clicks on map
30
+ coverage.addEventListener("select", e => {
31
+ console.log("Selected sequence", e.detail.seqId, "picture", e.detail.picId);
32
+ });
33
+
34
+ // You can also programatically change selection on map
35
+ coverage.select(
36
+ "c463d190-06b0-47fb-98a8-b4a775a39ad6", // A sequence ID
37
+ "bdea1eb4-4496-46da-a4d5-b22b16e75fa8" // A picture ID (can be null if unknown)
38
+ );
39
+ }, {once: true});
40
+ ```
41
+
42
+ All available interaction are listed in [Coverage Map reference](../reference/components/core/CoverageMap.md).
package/mkdocs.yml CHANGED
@@ -20,6 +20,7 @@ plugins:
20
20
  markdown_extensions:
21
21
  - admonition
22
22
  - pymdownx.superfences
23
+ - pymdownx.details
23
24
  - pymdownx.tabbed:
24
25
  alternate_style: true
25
26
  - pymdownx.highlight:
@@ -34,12 +35,66 @@ markdown_extensions:
34
35
  emoji_generator: !!python/name:material.extensions.emoji.to_svg
35
36
 
36
37
  nav:
37
- - 'Quick start': '01_Start.md'
38
- - Configuration:
38
+ - 'Quick start': 'index.md'
39
+ - 'Migrating to v4': 'tutorials/migrate_v4.md'
40
+ - Tips:
39
41
  - 'URL settings': '03_URL_settings.md'
40
- - 'Advanced examples': '04_Advanced_examples.md'
41
- - Developping:
42
+ - Shortcuts: 'shortcuts.md'
43
+ - Tutorials:
44
+ - 'Change map style': 'tutorials/map_style.md'
45
+ - 'Add aerial imagery': 'tutorials/aerial_imagery.md'
46
+ - 'Server authentication': 'tutorials/authentication.md'
47
+ - 'Custom widgets': 'tutorials/custom_widgets.md'
48
+ - 'Synced coverage map': 'tutorials/synced_coverage.md'
49
+ - Develop:
42
50
  - 'Where to start': '09_Develop.md'
43
- - 'Viewer''s API reference': '02_Usage.md'
44
51
  - 'STAC API compatibility': '05_Compatibility.md'
45
52
  - 'Make a release': '90_Releases.md'
53
+ - 'API reference':
54
+ - Overview: 'reference.md'
55
+ - components:
56
+ - core:
57
+ - Basic: 'reference/components/core/Basic.md'
58
+ - CoverageMap: 'reference/components/core/CoverageMap.md'
59
+ - Editor: 'reference/components/core/Editor.md'
60
+ - Viewer: 'reference/components/core/Viewer.md'
61
+ - layout:
62
+ - CorneredGrid: 'reference/components/layout/CorneredGrid.md'
63
+ - Mini: 'reference/components/layout/Mini.md'
64
+ - menus:
65
+ - MapBackground: 'reference/components/menus/MapBackground.md'
66
+ - MapFilters: 'reference/components/menus/MapFilters.md'
67
+ - MapLayers: 'reference/components/menus/MapLayers.md'
68
+ - MapLegend: 'reference/components/menus/MapLegend.md'
69
+ - PictureLegend: 'reference/components/menus/PictureLegend.md'
70
+ - PictureMetadata: 'reference/components/menus/PictureMetadata.md'
71
+ - PlayerOptions: 'reference/components/menus/PlayerOptions.md'
72
+ - QualityScoreDoc: 'reference/components/menus/QualityScoreDoc.md'
73
+ - ReportForm: 'reference/components/menus/ReportForm.md'
74
+ - ShareMenu: 'reference/components/menus/ShareMenu.md'
75
+ - ui:
76
+ - widgets:
77
+ - GeoSearch: 'reference/components/ui/widgets/GeoSearch.md'
78
+ - Legend: 'reference/components/ui/widgets/Legend.md'
79
+ - MapFiltersButton: 'reference/components/ui/widgets/MapFiltersButton.md'
80
+ - MapLayersButton: 'reference/components/ui/widgets/MapLayersButton.md'
81
+ - Player: 'reference/components/ui/widgets/Player.md'
82
+ - Share: 'reference/components/ui/widgets/Share.md'
83
+ - Zoom: 'reference/components/ui/widgets/Zoom.md'
84
+ - Button: 'reference/components/ui/Button.md'
85
+ - ButtonGroup: 'reference/components/ui/ButtonGroup.md'
86
+ - CopyButton: 'reference/components/ui/CopyButton.md'
87
+ - Grade: 'reference/components/ui/Grade.md'
88
+ - LinkButton: 'reference/components/ui/LinkButton.md'
89
+ - Loader: 'reference/components/ui/Loader.md'
90
+ - Map: 'reference/components/ui/Map.md'
91
+ - MapMore: 'reference/components/ui/MapMore.md'
92
+ - Photo: 'reference/components/ui/Photo.md'
93
+ - Popup: 'reference/components/ui/Popup.md'
94
+ - QualityScore: 'reference/components/ui/QualityScore.md'
95
+ - SearchBar: 'reference/components/ui/SearchBar.md'
96
+ - TogglableGroup: 'reference/components/ui/TogglableGroup.md'
97
+ - utils:
98
+ - API: 'reference/utils/API.md'
99
+ - InitParameters: 'reference/utils/InitParameters.md'
100
+ - URLHandler: 'reference/utils/URLHandler.md'