@panoramax/web-viewer 3.2.3 → 4.0.0-develop-39167b4d
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/.gitlab-ci.yml +13 -6
- package/CHANGELOG.md +53 -1
- package/CODE_OF_CONDUCT.md +1 -1
- package/README.md +1 -1
- package/build/editor.html +10 -1
- package/build/index.css +12 -12
- package/build/index.css.map +1 -1
- package/build/index.html +1 -1
- package/build/index.js +2126 -14
- package/build/index.js.map +1 -1
- package/build/map.html +1 -1
- package/build/photo.html +1 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-400-normal..woff +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-400-normal..woff2 +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-ext-400-normal..woff +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-ext-400-normal..woff2 +0 -0
- package/build/viewer.html +12 -1
- package/build/widgets.html +1 -0
- package/config/jest/mocks.js +201 -0
- package/config/paths.js +2 -0
- package/config/webpack.config.js +52 -0
- package/docs/03_URL_settings.md +14 -16
- package/docs/05_Compatibility.md +59 -76
- package/docs/09_Develop.md +46 -11
- package/docs/90_Releases.md +2 -2
- package/docs/images/class_diagram.drawio +60 -45
- package/docs/images/class_diagram.jpg +0 -0
- package/docs/images/screenshot.jpg +0 -0
- package/docs/index.md +135 -0
- package/docs/reference/components/core/Basic.md +196 -0
- package/docs/reference/components/core/CoverageMap.md +210 -0
- package/docs/reference/components/core/Editor.md +224 -0
- package/docs/reference/components/core/PhotoViewer.md +307 -0
- package/docs/reference/components/core/Viewer.md +350 -0
- package/docs/reference/components/layout/BottomDrawer.md +35 -0
- package/docs/reference/components/layout/CorneredGrid.md +29 -0
- package/docs/reference/components/layout/Mini.md +45 -0
- package/docs/reference/components/layout/Tabs.md +45 -0
- package/docs/reference/components/menus/MapBackground.md +32 -0
- package/docs/reference/components/menus/MapFilters.md +15 -0
- package/docs/reference/components/menus/MapLayers.md +15 -0
- package/docs/reference/components/menus/MapLegend.md +15 -0
- package/docs/reference/components/menus/PictureLegend.md +16 -0
- package/docs/reference/components/menus/PictureMetadata.md +15 -0
- package/docs/reference/components/menus/PlayerOptions.md +15 -0
- package/docs/reference/components/menus/QualityScoreDoc.md +15 -0
- package/docs/reference/components/menus/ReportForm.md +15 -0
- package/docs/reference/components/menus/ShareMenu.md +15 -0
- package/docs/reference/components/ui/Button.md +40 -0
- package/docs/reference/components/ui/ButtonGroup.md +36 -0
- package/docs/reference/components/ui/CopyButton.md +38 -0
- package/docs/reference/components/ui/Grade.md +32 -0
- package/docs/reference/components/ui/LinkButton.md +45 -0
- package/docs/reference/components/ui/ListGroup.md +22 -0
- package/docs/reference/components/ui/Loader.md +56 -0
- package/docs/reference/components/ui/Map.md +239 -0
- package/docs/reference/components/ui/MapMore.md +256 -0
- package/docs/reference/components/ui/Photo.md +385 -0
- package/docs/reference/components/ui/Popup.md +56 -0
- package/docs/reference/components/ui/ProgressBar.md +32 -0
- package/docs/reference/components/ui/QualityScore.md +45 -0
- package/docs/reference/components/ui/SearchBar.md +63 -0
- package/docs/reference/components/ui/TogglableGroup.md +39 -0
- package/docs/reference/components/ui/widgets/GeoSearch.md +32 -0
- package/docs/reference/components/ui/widgets/Legend.md +49 -0
- package/docs/reference/components/ui/widgets/MapFiltersButton.md +33 -0
- package/docs/reference/components/ui/widgets/MapLayersButton.md +15 -0
- package/docs/reference/components/ui/widgets/OSMEditors.md +15 -0
- package/docs/reference/components/ui/widgets/PictureLegendActions.md +32 -0
- package/docs/reference/components/ui/widgets/Player.md +33 -0
- package/docs/reference/components/ui/widgets/Zoom.md +15 -0
- package/docs/reference/utils/API.md +334 -0
- package/docs/reference/utils/InitParameters.md +68 -0
- package/docs/reference/utils/URLHandler.md +107 -0
- package/docs/reference.md +79 -0
- package/docs/shortcuts.md +11 -0
- package/docs/tutorials/aerial_imagery.md +19 -0
- package/docs/tutorials/authentication.md +10 -0
- package/docs/tutorials/custom_widgets.md +59 -0
- package/docs/tutorials/map_style.md +39 -0
- package/docs/tutorials/migrate_v4.md +153 -0
- package/docs/tutorials/synced_coverage.md +43 -0
- package/mkdocs.yml +66 -5
- package/package.json +22 -17
- package/public/editor.html +21 -29
- package/public/index.html +17 -12
- package/public/map.html +19 -18
- package/public/photo.html +55 -0
- package/public/viewer.html +22 -26
- package/public/widgets.html +306 -0
- package/scripts/doc.js +79 -0
- package/src/components/core/Basic.css +48 -0
- package/src/components/core/Basic.js +349 -0
- package/src/components/core/CoverageMap.css +9 -0
- package/src/components/core/CoverageMap.js +139 -0
- package/src/components/core/Editor.css +23 -0
- package/src/components/core/Editor.js +390 -0
- package/src/components/core/PhotoViewer.css +48 -0
- package/src/components/core/PhotoViewer.js +499 -0
- package/src/components/core/Viewer.css +98 -0
- package/src/components/core/Viewer.js +564 -0
- package/src/components/core/index.js +12 -0
- package/src/components/index.js +13 -0
- package/src/components/layout/BottomDrawer.js +257 -0
- package/src/components/layout/CorneredGrid.js +112 -0
- package/src/components/layout/Mini.js +117 -0
- package/src/components/layout/Tabs.js +133 -0
- package/src/components/layout/index.js +9 -0
- package/src/components/menus/MapBackground.js +106 -0
- package/src/components/menus/MapFilters.js +400 -0
- package/src/components/menus/MapLayers.js +143 -0
- package/src/components/menus/MapLegend.js +34 -0
- package/src/components/menus/PictureLegend.js +257 -0
- package/src/components/menus/PictureMetadata.js +317 -0
- package/src/components/menus/PlayerOptions.js +95 -0
- package/src/components/menus/QualityScoreDoc.js +36 -0
- package/src/components/menus/ReportForm.js +133 -0
- package/src/components/menus/Share.js +100 -0
- package/src/components/menus/index.js +15 -0
- package/src/components/styles.js +383 -0
- package/src/components/ui/Button.js +77 -0
- package/src/components/ui/ButtonGroup.css +57 -0
- package/src/components/ui/ButtonGroup.js +68 -0
- package/src/components/ui/CopyButton.js +106 -0
- package/src/components/ui/Grade.js +54 -0
- package/src/components/ui/LinkButton.js +67 -0
- package/src/components/ui/ListGroup.js +66 -0
- package/src/components/ui/Loader.js +203 -0
- package/src/components/{Map.css → ui/Map.css} +5 -17
- package/src/components/{Map.js → ui/Map.js} +148 -156
- package/src/components/ui/MapMore.js +324 -0
- package/src/components/{Photo.css → ui/Photo.css} +6 -6
- package/src/components/{Photo.js → ui/Photo.js} +313 -101
- package/src/components/ui/Popup.js +145 -0
- package/src/components/ui/ProgressBar.js +104 -0
- package/src/components/ui/QualityScore.js +147 -0
- package/src/components/ui/SearchBar.js +367 -0
- package/src/components/ui/TogglableGroup.js +157 -0
- package/src/components/ui/index.js +22 -0
- package/src/components/ui/widgets/GeoSearch.css +21 -0
- package/src/components/ui/widgets/GeoSearch.js +139 -0
- package/src/components/ui/widgets/Legend.js +113 -0
- package/src/components/ui/widgets/MapFiltersButton.js +104 -0
- package/src/components/ui/widgets/MapLayersButton.js +79 -0
- package/src/components/ui/widgets/OSMEditors.js +155 -0
- package/src/components/ui/widgets/PictureLegendActions.js +117 -0
- package/src/components/ui/widgets/Player.css +7 -0
- package/src/components/ui/widgets/Player.js +151 -0
- package/src/components/ui/widgets/Zoom.js +82 -0
- package/src/components/ui/widgets/index.js +13 -0
- package/src/img/loader_base.jpg +0 -0
- package/src/img/panoramax.svg +13 -0
- package/src/img/switch_big.svg +20 -10
- package/src/index.js +7 -9
- package/src/translations/br.json +1 -0
- package/src/translations/da.json +38 -15
- package/src/translations/de.json +5 -3
- package/src/translations/en.json +35 -15
- package/src/translations/eo.json +38 -15
- package/src/translations/es.json +1 -1
- package/src/translations/fr.json +36 -16
- package/src/translations/hu.json +1 -1
- package/src/translations/it.json +39 -16
- package/src/translations/ja.json +182 -1
- package/src/translations/nl.json +106 -6
- package/src/translations/pl.json +1 -1
- package/src/translations/sv.json +182 -0
- package/src/translations/zh_Hant.json +35 -14
- package/src/utils/API.js +109 -49
- package/src/utils/InitParameters.js +388 -0
- package/src/utils/PhotoAdapter.js +1 -0
- package/src/utils/URLHandler.js +362 -0
- package/src/utils/geocoder.js +152 -0
- package/src/utils/{I18n.js → i18n.js} +7 -3
- package/src/utils/index.js +11 -0
- package/src/utils/{Map.js → map.js} +256 -77
- package/src/utils/picture.js +442 -0
- package/src/utils/utils.js +324 -0
- package/src/utils/widgets.js +55 -0
- package/tests/components/core/Basic.test.js +121 -0
- package/tests/components/core/BasicMock.js +25 -0
- package/tests/components/core/CoverageMap.test.js +20 -0
- package/tests/components/core/Editor.test.js +20 -0
- package/tests/components/core/PhotoViewer.test.js +57 -0
- package/tests/components/core/Viewer.test.js +84 -0
- package/tests/components/core/__snapshots__/PhotoViewer.test.js.snap +73 -0
- package/tests/components/core/__snapshots__/Viewer.test.js.snap +145 -0
- package/tests/components/ui/CopyButton.test.js +52 -0
- package/tests/components/ui/Loader.test.js +55 -0
- package/tests/components/{Map.test.js → ui/Map.test.js} +73 -61
- package/tests/components/{Photo.test.js → ui/Photo.test.js} +97 -63
- package/tests/components/ui/Popup.test.js +26 -0
- package/tests/components/ui/QualityScore.test.js +18 -0
- package/tests/components/ui/SearchBar.test.js +110 -0
- package/tests/components/ui/__snapshots__/CopyButton.test.js.snap +33 -0
- package/tests/components/ui/__snapshots__/Loader.test.js.snap +56 -0
- package/tests/components/{__snapshots__ → ui/__snapshots__}/Map.test.js.snap +11 -38
- package/tests/components/{__snapshots__ → ui/__snapshots__}/Photo.test.js.snap +70 -6
- package/tests/components/ui/__snapshots__/Popup.test.js.snap +29 -0
- package/tests/components/ui/__snapshots__/QualityScore.test.js.snap +11 -0
- package/tests/components/ui/__snapshots__/SearchBar.test.js.snap +65 -0
- package/tests/utils/API.test.js +83 -83
- package/tests/utils/InitParameters.test.js +499 -0
- package/tests/utils/URLHandler.test.js +401 -0
- package/tests/utils/__snapshots__/API.test.js.snap +10 -0
- package/tests/utils/__snapshots__/URLHandler.test.js.snap +21 -0
- package/tests/utils/__snapshots__/{Map.test.js.snap → geocoder.test.js.snap} +1 -1
- package/tests/utils/__snapshots__/map.test.js.snap +11 -0
- package/tests/utils/__snapshots__/picture.test.js.snap +327 -0
- package/tests/utils/__snapshots__/widgets.test.js.snap +19 -0
- package/tests/utils/geocoder.test.js +37 -0
- package/tests/utils/{I18n.test.js → i18n.test.js} +8 -8
- package/tests/utils/map.test.js +126 -0
- package/tests/utils/picture.test.js +745 -0
- package/tests/utils/utils.test.js +288 -0
- package/tests/utils/widgets.test.js +31 -0
- package/docs/01_Start.md +0 -149
- package/docs/02_Usage.md +0 -831
- package/docs/04_Advanced_examples.md +0 -216
- package/src/Editor.css +0 -37
- package/src/Editor.js +0 -361
- package/src/StandaloneMap.js +0 -114
- package/src/Viewer.css +0 -203
- package/src/Viewer.js +0 -1246
- package/src/components/CoreView.css +0 -70
- package/src/components/CoreView.js +0 -175
- package/src/components/Loader.css +0 -74
- package/src/components/Loader.js +0 -120
- package/src/img/loader_hd.jpg +0 -0
- package/src/utils/Exif.js +0 -193
- package/src/utils/Utils.js +0 -631
- package/src/utils/Widgets.js +0 -562
- package/src/viewer/URLHash.js +0 -469
- package/src/viewer/Widgets.css +0 -880
- package/src/viewer/Widgets.js +0 -1470
- package/tests/Editor.test.js +0 -126
- package/tests/StandaloneMap.test.js +0 -45
- package/tests/Viewer.test.js +0 -366
- package/tests/__snapshots__/Editor.test.js.snap +0 -298
- package/tests/__snapshots__/StandaloneMap.test.js.snap +0 -30
- package/tests/__snapshots__/Viewer.test.js.snap +0 -195
- package/tests/components/CoreView.test.js +0 -92
- package/tests/components/Loader.test.js +0 -38
- package/tests/components/__snapshots__/Loader.test.js.snap +0 -15
- package/tests/utils/Exif.test.js +0 -124
- package/tests/utils/Map.test.js +0 -113
- package/tests/utils/Utils.test.js +0 -300
- package/tests/utils/Widgets.test.js +0 -107
- package/tests/utils/__snapshots__/Exif.test.js.snap +0 -43
- package/tests/utils/__snapshots__/Utils.test.js.snap +0 -41
- package/tests/utils/__snapshots__/Widgets.test.js.snap +0 -44
- package/tests/viewer/URLHash.test.js +0 -559
- package/tests/viewer/Widgets.test.js +0 -127
- package/tests/viewer/__snapshots__/URLHash.test.js.snap +0 -108
- package/tests/viewer/__snapshots__/Widgets.test.js.snap +0 -403
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
<a name="Panoramax.components.core.PhotoViewer"></a>
|
|
2
|
+
|
|
3
|
+
## Panoramax.components.core.PhotoViewer ⇐ [<code>Basic</code>](Basic.md/#Panoramax.components.core.Basic)
|
|
4
|
+
**Kind**: static class of <code>Panoramax.components.core</code>
|
|
5
|
+
**Extends**: [<code>Basic</code>](Basic.md/#Panoramax.components.core.Basic)
|
|
6
|
+
**Emits**: [<code>select</code>](Basic.md/#Panoramax.components.core.Basic+event_select), [<code>ready</code>](Basic.md/#Panoramax.components.core.Basic+event_ready), [<code>broken</code>](Basic.md/#Panoramax.components.core.Basic+event_broken)
|
|
7
|
+
**Element**: pnx-photo-viewer
|
|
8
|
+
**Slot**: `top-left` The top-left corner
|
|
9
|
+
**Slot**: `top` The top middle corner
|
|
10
|
+
**Slot**: `top-right` The top-right corner
|
|
11
|
+
**Slot**: `bottom-left` The bottom-left corner
|
|
12
|
+
**Slot**: `bottom` The bottom middle corner
|
|
13
|
+
**Slot**: `bottom-right` The bottom-right corner
|
|
14
|
+
**Slot**: `editors` External links to map editors, or any tool that may be helpful. Defaults to OSM tools (iD & JOSM).
|
|
15
|
+
**Properties**
|
|
16
|
+
|
|
17
|
+
| Name | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| loader | [<code>Loader</code>](../ui/Loader.md/#Panoramax.components.ui.Loader) | The loader screen |
|
|
20
|
+
| api | [<code>API</code>](../../utils/API.md/#Panoramax.utils.API) | The API manager |
|
|
21
|
+
| psv | [<code>Photo</code>](../ui/Photo.md/#Panoramax.components.ui.Photo) | The Photo Sphere Viewer component itself |
|
|
22
|
+
| grid | [<code>CorneredGrid</code>](../layout/CorneredGrid.md/#Panoramax.components.layout.CorneredGrid) | The grid layout manager |
|
|
23
|
+
| popup | [<code>Popup</code>](../ui/Popup.md/#Panoramax.components.ui.Popup) | The popup container |
|
|
24
|
+
| urlHandler | [<code>URLHandler</code>](../../utils/URLHandler.md/#Panoramax.utils.URLHandler) | The URL query parameters manager |
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
* [.PhotoViewer](#Panoramax.components.core.PhotoViewer) ⇐ [<code>Basic</code>](Basic.md/#Panoramax.components.core.Basic)
|
|
28
|
+
* [new PhotoViewer()](#new_Panoramax.components.core.PhotoViewer_new)
|
|
29
|
+
* [.properties](#Panoramax.components.core.PhotoViewer+properties) : <code>Object</code>
|
|
30
|
+
* [.onceReady()](#Panoramax.components.core.PhotoViewer+onceReady) ⇒ <code>Promise</code>
|
|
31
|
+
* [.oncePSVReady()](#Panoramax.components.core.PhotoViewer+oncePSVReady) ⇒ <code>Promise</code>
|
|
32
|
+
* [.onceFirstPicLoaded()](#Panoramax.components.core.PhotoViewer+onceFirstPicLoaded) ⇒ <code>Promise</code>
|
|
33
|
+
* [.setPopup(visible, [content])](#Panoramax.components.core.PhotoViewer+setPopup)
|
|
34
|
+
* [.moveCenter()](#Panoramax.components.core.PhotoViewer+moveCenter)
|
|
35
|
+
* [.moveLeft()](#Panoramax.components.core.PhotoViewer+moveLeft)
|
|
36
|
+
* [.moveRight()](#Panoramax.components.core.PhotoViewer+moveRight)
|
|
37
|
+
* [.moveUp()](#Panoramax.components.core.PhotoViewer+moveUp)
|
|
38
|
+
* [.moveDown()](#Panoramax.components.core.PhotoViewer+moveDown)
|
|
39
|
+
* [.addEventListener(type, listener, [options])](#Panoramax.components.core.PhotoViewer+addEventListener)
|
|
40
|
+
* [.onceAPIReady()](Basic.md/#Panoramax.components.core.Basic+onceAPIReady) ⇒ <code>Promise</code>
|
|
41
|
+
* [.getClassName()](Basic.md/#Panoramax.components.core.Basic+getClassName) ⇒ <code>string</code>
|
|
42
|
+
* [.select([seqId], [picId], [force])](#Panoramax.components.core.Basic+select)
|
|
43
|
+
* [.isWidthSmall()](Basic.md/#Panoramax.components.core.Basic+isWidthSmall) ⇒ <code>boolean</code>
|
|
44
|
+
* [.isHeightSmall()](Basic.md/#Panoramax.components.core.Basic+isHeightSmall) ⇒ <code>boolean</code>
|
|
45
|
+
* [.getSubComponentsNames()](Basic.md/#Panoramax.components.core.Basic+getSubComponentsNames) ⇒ <code>Array.<string></code>
|
|
46
|
+
* ["menu-opened"](Basic.md/#Panoramax.components.core.Basic+event_menu-opened)
|
|
47
|
+
* ["select"](Basic.md/#Panoramax.components.core.Basic+event_select)
|
|
48
|
+
* ["ready"](Basic.md/#Panoramax.components.core.Basic+event_ready)
|
|
49
|
+
* ["broken"](Basic.md/#Panoramax.components.core.Basic+event_broken)
|
|
50
|
+
|
|
51
|
+
<a name="new_Panoramax.components.core.PhotoViewer_new"></a>
|
|
52
|
+
|
|
53
|
+
### new PhotoViewer()
|
|
54
|
+
Photo Viewer is a component showing pictures (without any map).
|
|
55
|
+
|
|
56
|
+
This component has a [CorneredGrid](../layout/CorneredGrid.md/#Panoramax.components.layout.CorneredGrid) layout, you can use directly any slot element to pass custom widgets.
|
|
57
|
+
|
|
58
|
+
If you need a viewer with map, checkout [Viewer component](Viewer.md/#Panoramax.components.core.Viewer).
|
|
59
|
+
|
|
60
|
+
Make sure to set width/height through CSS for proper display.
|
|
61
|
+
|
|
62
|
+
**Example**
|
|
63
|
+
```html
|
|
64
|
+
<!-- Basic example -->
|
|
65
|
+
<pnx-photo-viewer
|
|
66
|
+
endpoint="https://panoramax.openstreetmap.fr/"
|
|
67
|
+
style="width: 300px; height: 250px"
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<!-- With slotted widgets -->
|
|
71
|
+
<pnx-photo-viewer
|
|
72
|
+
endpoint="https://panoramax.openstreetmap.fr/"
|
|
73
|
+
style="width: 300px; height: 250px"
|
|
74
|
+
>
|
|
75
|
+
<p slot="top-right">My custom text</p>
|
|
76
|
+
<p slot="editors"><a href="https://my.own.tool/">Edit in my own tool</a></p>
|
|
77
|
+
</pnx-photo-viewer>
|
|
78
|
+
|
|
79
|
+
<!-- With only your custom widgets -->
|
|
80
|
+
<pnx-photo-viewer
|
|
81
|
+
endpoint="https://panoramax.openstreetmap.fr/"
|
|
82
|
+
style="width: 300px; height: 250px"
|
|
83
|
+
widgets="false"
|
|
84
|
+
>
|
|
85
|
+
<p slot="top-right">My custom text</p>
|
|
86
|
+
</pnx-photo-viewer>
|
|
87
|
+
```
|
|
88
|
+
<a name="Panoramax.components.core.PhotoViewer+properties"></a>
|
|
89
|
+
|
|
90
|
+
### photoViewer.properties : <code>Object</code>
|
|
91
|
+
Component properties. All of [Basic properties](Basic.md/#Panoramax.components.core.Basic+properties) are available as well.
|
|
92
|
+
|
|
93
|
+
**Kind**: instance property of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
94
|
+
**Mixes**: [<code>properties</code>](Basic.md/#Panoramax.components.core.Basic+properties)
|
|
95
|
+
**Overrides**: [<code>properties</code>](Basic.md/#Panoramax.components.core.Basic+properties)
|
|
96
|
+
**Properties**
|
|
97
|
+
|
|
98
|
+
| Name | Type | Default | Description |
|
|
99
|
+
| --- | --- | --- | --- |
|
|
100
|
+
| endpoint | <code>string</code> | | URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md)) |
|
|
101
|
+
| [psv] | <code>object</code> | | [Any option to pass to Photo component](../ui/Photo.md/#Panoramax.components.ui.Photo) as an object.<br />Example: `psv="{'transitionDuration': 500, 'picturesNavigation': 'pic'}"` |
|
|
102
|
+
| [widgets] | <code>string</code> | <code>true</code> | Use default set of widgets ? Set to false to avoid any widget to show up, and use slots to populate as you like. |
|
|
103
|
+
| [picture] | <code>string</code> | | The picture ID to display |
|
|
104
|
+
| [sequence] | <code>string</code> | | The sequence ID of the picture displayed |
|
|
105
|
+
| [fetchOptions] | <code>object</code> | | Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters)) |
|
|
106
|
+
| [lang] | <code>string</code> | | To override language used for labels. Defaults to using user's preferred languages. |
|
|
107
|
+
| [url-parameters] | <code>string</code> | <code>true</code> | Should the component add and update URL query parameters to save viewer state ? |
|
|
108
|
+
|
|
109
|
+
<a name="Panoramax.components.core.PhotoViewer+onceReady"></a>
|
|
110
|
+
|
|
111
|
+
### photoViewer.onceReady() ⇒ <code>Promise</code>
|
|
112
|
+
Waits for PhotoViewer to be completely ready (map & PSV loaded, first picture also if one is wanted)
|
|
113
|
+
|
|
114
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
115
|
+
**Overrides**: [<code>onceReady</code>](Basic.md/#Panoramax.components.core.Basic+onceReady)
|
|
116
|
+
**Returns**: <code>Promise</code> - When viewer is ready
|
|
117
|
+
<a name="Panoramax.components.core.PhotoViewer+oncePSVReady"></a>
|
|
118
|
+
|
|
119
|
+
### photoViewer.oncePSVReady() ⇒ <code>Promise</code>
|
|
120
|
+
Waiting for Photo Sphere Viewer to be available.
|
|
121
|
+
|
|
122
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
123
|
+
**Returns**: <code>Promise</code> - When PSV is ready to use
|
|
124
|
+
<a name="Panoramax.components.core.PhotoViewer+onceFirstPicLoaded"></a>
|
|
125
|
+
|
|
126
|
+
### photoViewer.onceFirstPicLoaded() ⇒ <code>Promise</code>
|
|
127
|
+
Waits for first picture to display on PSV.
|
|
128
|
+
|
|
129
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
130
|
+
**Fulfil**: <code>undefined</code> When picture is shown
|
|
131
|
+
<a name="Panoramax.components.core.PhotoViewer+setPopup"></a>
|
|
132
|
+
|
|
133
|
+
### photoViewer.setPopup(visible, [content])
|
|
134
|
+
Change full-page popup visibility and content
|
|
135
|
+
|
|
136
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
137
|
+
|
|
138
|
+
| Param | Type | Default | Description |
|
|
139
|
+
| --- | --- | --- | --- |
|
|
140
|
+
| visible | <code>boolean</code> | | True to make it appear |
|
|
141
|
+
| [content] | <code>string</code> \| <code>Array.<Element></code> | <code>null</code> | The new popup content |
|
|
142
|
+
|
|
143
|
+
<a name="Panoramax.components.core.PhotoViewer+moveCenter"></a>
|
|
144
|
+
|
|
145
|
+
### photoViewer.moveCenter()
|
|
146
|
+
Move the view of main component to its center.
|
|
147
|
+
For map, center view on selected picture.
|
|
148
|
+
For picture, center view on image center.
|
|
149
|
+
|
|
150
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
151
|
+
<a name="Panoramax.components.core.PhotoViewer+moveLeft"></a>
|
|
152
|
+
|
|
153
|
+
### photoViewer.moveLeft()
|
|
154
|
+
Moves the view of main component slightly to the left.
|
|
155
|
+
|
|
156
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
157
|
+
<a name="Panoramax.components.core.PhotoViewer+moveRight"></a>
|
|
158
|
+
|
|
159
|
+
### photoViewer.moveRight()
|
|
160
|
+
Moves the view of main component slightly to the right.
|
|
161
|
+
|
|
162
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
163
|
+
<a name="Panoramax.components.core.PhotoViewer+moveUp"></a>
|
|
164
|
+
|
|
165
|
+
### photoViewer.moveUp()
|
|
166
|
+
Moves the view of main component slightly to the top.
|
|
167
|
+
|
|
168
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
169
|
+
<a name="Panoramax.components.core.PhotoViewer+moveDown"></a>
|
|
170
|
+
|
|
171
|
+
### photoViewer.moveDown()
|
|
172
|
+
Moves the view of main component slightly to the bottom.
|
|
173
|
+
|
|
174
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
175
|
+
<a name="Panoramax.components.core.PhotoViewer+addEventListener"></a>
|
|
176
|
+
|
|
177
|
+
### photoViewer.addEventListener(type, listener, [options])
|
|
178
|
+
Listen to events from this components or one of its sub-components.
|
|
179
|
+
|
|
180
|
+
For example, you can listen to `psv` events using prefix `psv:`.
|
|
181
|
+
|
|
182
|
+
```js
|
|
183
|
+
me.addEventListener("psv:picture-loading", doSomething);
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
187
|
+
**Overrides**: [<code>addEventListener</code>](Basic.md/#Panoramax.components.core.Basic+addEventListener)
|
|
188
|
+
|
|
189
|
+
| Param | Type | Description |
|
|
190
|
+
| --- | --- | --- |
|
|
191
|
+
| type | <code>string</code> | The event type to listen for |
|
|
192
|
+
| listener | <code>function</code> | The event handler |
|
|
193
|
+
| [options] | <code>object</code> | [Any original addEventListener available options](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#options) |
|
|
194
|
+
|
|
195
|
+
<a name="Panoramax.components.core.Basic+onceAPIReady"></a>
|
|
196
|
+
|
|
197
|
+
### photoViewer.onceAPIReady() ⇒ <code>Promise</code>
|
|
198
|
+
Waits for initial API setup.
|
|
199
|
+
|
|
200
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
201
|
+
**Fulfil**: <code>null</code> When API is ready.
|
|
202
|
+
**Reject**: <code>string</code> Error message
|
|
203
|
+
<a name="Panoramax.components.core.Basic+getClassName"></a>
|
|
204
|
+
|
|
205
|
+
### photoViewer.getClassName() ⇒ <code>string</code>
|
|
206
|
+
This allows to retrieve an always correct class name.
|
|
207
|
+
This is crap, but avoids issues with Webpack & so on.
|
|
208
|
+
|
|
209
|
+
Each inheriting class must override this method.
|
|
210
|
+
|
|
211
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
212
|
+
**Returns**: <code>string</code> - The class name (for example "Basic")
|
|
213
|
+
<a name="Panoramax.components.core.Basic+select"></a>
|
|
214
|
+
|
|
215
|
+
### photoViewer.select([seqId], [picId], [force])
|
|
216
|
+
Change the currently picture and/or sequence.
|
|
217
|
+
Calling the method without parameters unselects.
|
|
218
|
+
|
|
219
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
220
|
+
|
|
221
|
+
| Param | Type | Default | Description |
|
|
222
|
+
| --- | --- | --- | --- |
|
|
223
|
+
| [seqId] | <code>string</code> | <code>null</code> | The sequence UUID |
|
|
224
|
+
| [picId] | <code>string</code> | <code>null</code> | The picture UUID |
|
|
225
|
+
| [force] | <code>boolean</code> | <code>false</code> | Force select even if already selected |
|
|
226
|
+
|
|
227
|
+
<a name="Panoramax.components.core.Basic+isWidthSmall"></a>
|
|
228
|
+
|
|
229
|
+
### photoViewer.isWidthSmall() ⇒ <code>boolean</code>
|
|
230
|
+
Is the view running in a small container (small embed or smartphone)
|
|
231
|
+
|
|
232
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
233
|
+
**Returns**: <code>boolean</code> - True if container is small
|
|
234
|
+
<a name="Panoramax.components.core.Basic+isHeightSmall"></a>
|
|
235
|
+
|
|
236
|
+
### photoViewer.isHeightSmall() ⇒ <code>boolean</code>
|
|
237
|
+
Is the view running in a small-height container (small embed or smartphone)
|
|
238
|
+
|
|
239
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
240
|
+
**Returns**: <code>boolean</code> - True if container height is small
|
|
241
|
+
<a name="Panoramax.components.core.Basic+getSubComponentsNames"></a>
|
|
242
|
+
|
|
243
|
+
### photoViewer.getSubComponentsNames() ⇒ <code>Array.<string></code>
|
|
244
|
+
List names of sub-components (like loader, api, map, psv) available in this component.
|
|
245
|
+
|
|
246
|
+
**Kind**: instance method of [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
247
|
+
**Returns**: <code>Array.<string></code> - Sub-components names.
|
|
248
|
+
<a name="Panoramax.components.core.Basic+event_menu-opened"></a>
|
|
249
|
+
|
|
250
|
+
### "menu-opened"
|
|
251
|
+
Event for overlaying menu opening
|
|
252
|
+
|
|
253
|
+
**Kind**: event emitted by [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
254
|
+
**Properties**
|
|
255
|
+
|
|
256
|
+
| Name | Type | Description |
|
|
257
|
+
| --- | --- | --- |
|
|
258
|
+
| detail.menu | <code>Element</code> | The opened menu |
|
|
259
|
+
|
|
260
|
+
<a name="Panoramax.components.core.Basic+event_select"></a>
|
|
261
|
+
|
|
262
|
+
### "select"
|
|
263
|
+
Event for sequence/picture selection
|
|
264
|
+
|
|
265
|
+
**Kind**: event emitted by [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
266
|
+
**Properties**
|
|
267
|
+
|
|
268
|
+
| Name | Type | Description |
|
|
269
|
+
| --- | --- | --- |
|
|
270
|
+
| detail.seqId | <code>string</code> | The selected sequence ID |
|
|
271
|
+
| detail.picId | <code>string</code> | The selected picture ID (or null if not a precise picture clicked) |
|
|
272
|
+
| [detail.prevSeqId] | <code>string</code> | The previously selected sequence ID (or null if none) |
|
|
273
|
+
| [detail.prevPicId] | <code>string</code> | The previously selected picture ID (or null if none) |
|
|
274
|
+
|
|
275
|
+
<a name="Panoramax.components.core.Basic+event_ready"></a>
|
|
276
|
+
|
|
277
|
+
### "ready"
|
|
278
|
+
Event when component is ready to use.
|
|
279
|
+
This happens when loader screen disappear, with picture and map loaded.
|
|
280
|
+
|
|
281
|
+
To follow more precisely loading steps, you can also watch for sub-components `ready` events.
|
|
282
|
+
```js
|
|
283
|
+
// Watch API-readiness
|
|
284
|
+
viewer.addEventListener("api:ready", ...); // From parent
|
|
285
|
+
viewer.api.addEventListener("ready", ...); // Or on sub-component
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Kind**: event emitted by [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
289
|
+
<a name="Panoramax.components.core.Basic+event_broken"></a>
|
|
290
|
+
|
|
291
|
+
### "broken"
|
|
292
|
+
Event for viewer failing to initially load.
|
|
293
|
+
|
|
294
|
+
To follow more precisely loading failures, you can also watch for sub-components `broken` events.
|
|
295
|
+
```js
|
|
296
|
+
// Watch API breaks
|
|
297
|
+
viewer.addEventListener("api:broken", ...); // From parent
|
|
298
|
+
viewer.api.addEventListener("broken", ...); // Or on sub-component
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Kind**: event emitted by [<code>PhotoViewer</code>](#Panoramax.components.core.PhotoViewer)
|
|
302
|
+
**Properties**
|
|
303
|
+
|
|
304
|
+
| Name | Type | Description |
|
|
305
|
+
| --- | --- | --- |
|
|
306
|
+
| detail.error | <code>string</code> | The user-friendly error message to display |
|
|
307
|
+
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
<a name="Panoramax.components.core.Viewer"></a>
|
|
2
|
+
|
|
3
|
+
## Panoramax.components.core.Viewer ⇐ [<code>PhotoViewer</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer)
|
|
4
|
+
**Kind**: static class of <code>Panoramax.components.core</code>
|
|
5
|
+
**Extends**: [<code>PhotoViewer</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer)
|
|
6
|
+
**Emits**: [<code>select</code>](Basic.md/#Panoramax.components.core.Basic+event_select), [<code>ready</code>](Basic.md/#Panoramax.components.core.Basic+event_ready), [<code>broken</code>](Basic.md/#Panoramax.components.core.Basic+event_broken), [<code>focus-changed</code>](#Panoramax.components.core.Viewer+event_focus-changed)
|
|
7
|
+
**Element**: pnx-viewer
|
|
8
|
+
**Slot**: `top-left` The top-left corner
|
|
9
|
+
**Slot**: `top` The top middle corner
|
|
10
|
+
**Slot**: `top-right` The top-right corner
|
|
11
|
+
**Slot**: `bottom-left` The bottom-left corner
|
|
12
|
+
**Slot**: `bottom` The bottom middle corner
|
|
13
|
+
**Slot**: `bottom-right` The bottom-right corner
|
|
14
|
+
**Slot**: `editors` External links to map editors, or any tool that may be helpful. Defaults to OSM tools (iD & JOSM).
|
|
15
|
+
**Properties**
|
|
16
|
+
|
|
17
|
+
| Name | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| loader | [<code>Loader</code>](../ui/Loader.md/#Panoramax.components.ui.Loader) | The loader screen |
|
|
20
|
+
| api | [<code>API</code>](../../utils/API.md/#Panoramax.utils.API) | The API manager |
|
|
21
|
+
| map | [<code>MapMore</code>](../ui/MapMore.md/#Panoramax.components.ui.MapMore) | The MapLibre GL map itself |
|
|
22
|
+
| psv | [<code>Photo</code>](../ui/Photo.md/#Panoramax.components.ui.Photo) | The Photo Sphere Viewer component itself |
|
|
23
|
+
| grid | [<code>CorneredGrid</code>](../layout/CorneredGrid.md/#Panoramax.components.layout.CorneredGrid) | The grid layout manager |
|
|
24
|
+
| mini | [<code>Mini</code>](../layout/Mini.md/#Panoramax.components.layout.Mini) | The reduced/collapsed map/photo component |
|
|
25
|
+
| popup | [<code>Popup</code>](../ui/Popup.md/#Panoramax.components.ui.Popup) | The popup container |
|
|
26
|
+
| urlHandler | [<code>URLHandler</code>](../../utils/URLHandler.md/#Panoramax.utils.URLHandler) | The URL query parameters manager |
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
* [.Viewer](#Panoramax.components.core.Viewer) ⇐ [<code>PhotoViewer</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer)
|
|
30
|
+
* [new Viewer()](#new_Panoramax.components.core.Viewer_new)
|
|
31
|
+
* [.properties](#Panoramax.components.core.Viewer+properties) : <code>Object</code>
|
|
32
|
+
* [.onceReady()](#Panoramax.components.core.Viewer+onceReady) ⇒ <code>Promise</code>
|
|
33
|
+
* [.onceMapReady()](#Panoramax.components.core.Viewer+onceMapReady) ⇒ <code>Promise</code>
|
|
34
|
+
* [.moveCenter()](#Panoramax.components.core.Viewer+moveCenter)
|
|
35
|
+
* [.isMapWide()](#Panoramax.components.core.Viewer+isMapWide) ⇒ <code>boolean</code>
|
|
36
|
+
* [.oncePSVReady()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+oncePSVReady) ⇒ <code>Promise</code>
|
|
37
|
+
* [.onceFirstPicLoaded()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+onceFirstPicLoaded) ⇒ <code>Promise</code>
|
|
38
|
+
* [.setPopup(visible, [content])](#Panoramax.components.core.PhotoViewer+setPopup)
|
|
39
|
+
* [.moveLeft()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+moveLeft)
|
|
40
|
+
* [.moveRight()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+moveRight)
|
|
41
|
+
* [.moveUp()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+moveUp)
|
|
42
|
+
* [.moveDown()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+moveDown)
|
|
43
|
+
* [.addEventListener(type, listener, [options])](#Panoramax.components.core.PhotoViewer+addEventListener)
|
|
44
|
+
* [.onceAPIReady()](Basic.md/#Panoramax.components.core.Basic+onceAPIReady) ⇒ <code>Promise</code>
|
|
45
|
+
* [.getClassName()](Basic.md/#Panoramax.components.core.Basic+getClassName) ⇒ <code>string</code>
|
|
46
|
+
* [.select([seqId], [picId], [force])](#Panoramax.components.core.Basic+select)
|
|
47
|
+
* [.isWidthSmall()](Basic.md/#Panoramax.components.core.Basic+isWidthSmall) ⇒ <code>boolean</code>
|
|
48
|
+
* [.isHeightSmall()](Basic.md/#Panoramax.components.core.Basic+isHeightSmall) ⇒ <code>boolean</code>
|
|
49
|
+
* [.getSubComponentsNames()](Basic.md/#Panoramax.components.core.Basic+getSubComponentsNames) ⇒ <code>Array.<string></code>
|
|
50
|
+
* ["focus-changed"](#Panoramax.components.core.Viewer+event_focus-changed)
|
|
51
|
+
* ["menu-opened"](Basic.md/#Panoramax.components.core.Basic+event_menu-opened)
|
|
52
|
+
* ["select"](Basic.md/#Panoramax.components.core.Basic+event_select)
|
|
53
|
+
* ["ready"](Basic.md/#Panoramax.components.core.Basic+event_ready)
|
|
54
|
+
* ["broken"](Basic.md/#Panoramax.components.core.Basic+event_broken)
|
|
55
|
+
|
|
56
|
+
<a name="new_Panoramax.components.core.Viewer_new"></a>
|
|
57
|
+
|
|
58
|
+
### new Viewer()
|
|
59
|
+
Viewer is the main component of Panoramax JS library, showing pictures and map.
|
|
60
|
+
|
|
61
|
+
This component has a [CorneredGrid](../layout/CorneredGrid.md/#Panoramax.components.layout.CorneredGrid) layout, you can use directly any slot element to pass custom widgets.
|
|
62
|
+
|
|
63
|
+
If you need a viewer without map, checkout [Photo Viewer component](PhotoViewer.md/#Panoramax.components.core.PhotoViewer).
|
|
64
|
+
|
|
65
|
+
Make sure to set width/height through CSS for proper display.
|
|
66
|
+
|
|
67
|
+
**Example**
|
|
68
|
+
```html
|
|
69
|
+
<!-- Basic example -->
|
|
70
|
+
<pnx-viewer
|
|
71
|
+
endpoint="https://panoramax.openstreetmap.fr/"
|
|
72
|
+
style="width: 300px; height: 250px"
|
|
73
|
+
/>
|
|
74
|
+
|
|
75
|
+
<!-- With slotted widgets -->
|
|
76
|
+
<pnx-viewer
|
|
77
|
+
endpoint="https://panoramax.openstreetmap.fr/"
|
|
78
|
+
style="width: 300px; height: 250px"
|
|
79
|
+
>
|
|
80
|
+
<p slot="top-right">My custom text</p>
|
|
81
|
+
<p slot="editors"><a href="https://my.own.tool/">Edit in my own tool</a></p>
|
|
82
|
+
</pnx-viewer>
|
|
83
|
+
|
|
84
|
+
<!-- With only your custom widgets -->
|
|
85
|
+
<pnx-viewer
|
|
86
|
+
endpoint="https://panoramax.openstreetmap.fr/"
|
|
87
|
+
style="width: 300px; height: 250px"
|
|
88
|
+
widgets="false"
|
|
89
|
+
>
|
|
90
|
+
<p slot="top-right">My custom text</p>
|
|
91
|
+
</pnx-viewer>
|
|
92
|
+
|
|
93
|
+
<!-- With map options -->
|
|
94
|
+
<pnx-viewer
|
|
95
|
+
endpoint="https://panoramax.openstreetmap.fr/"
|
|
96
|
+
style="width: 300px; height: 250px"
|
|
97
|
+
map="{'maxZoom': 15, 'background': 'aerial', 'raster': '...'}"
|
|
98
|
+
/>
|
|
99
|
+
```
|
|
100
|
+
<a name="Panoramax.components.core.Viewer+properties"></a>
|
|
101
|
+
|
|
102
|
+
### viewer.properties : <code>Object</code>
|
|
103
|
+
Component properties. All of [Basic properties](Basic.md/#Panoramax.components.core.Basic+properties) are available as well.
|
|
104
|
+
|
|
105
|
+
**Kind**: instance property of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
106
|
+
**Mixes**: [<code>properties</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+properties)
|
|
107
|
+
**Overrides**: [<code>properties</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+properties)
|
|
108
|
+
**Properties**
|
|
109
|
+
|
|
110
|
+
| Name | Type | Default | Description |
|
|
111
|
+
| --- | --- | --- | --- |
|
|
112
|
+
| endpoint | <code>string</code> | | URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md)) |
|
|
113
|
+
| [map] | <code>object</code> | | An object with [any map option available in Map or MapMore class](../ui/MapMore.md/#Panoramax.components.ui.MapMore).<br />Example: `map="{'background': 'aerial', 'theme': 'age'}"` |
|
|
114
|
+
| [psv] | <code>object</code> | | [Any option to pass to Photo component](../ui/Photo.md/#Panoramax.components.ui.Photo) as an object.<br />Example: `psv="{'transitionDuration': 500, 'picturesNavigation': 'pic'}"` |
|
|
115
|
+
| [url-parameters] | <code>string</code> | <code>true</code> | Should the component add and update URL query parameters to save viewer state ? |
|
|
116
|
+
| [focus] | <code>string</code> | <code>"pic"</code> | The component showing up as main component (pic, map) |
|
|
117
|
+
| [geocoder] | <code>string</code> | <code>"nominatim"</code> | The geocoder engine to use (nominatim, ban) |
|
|
118
|
+
| [widgets] | <code>string</code> | <code>true</code> | Use default set of widgets ? Set to false to avoid any widget to show up, and use slots to populate as you like. |
|
|
119
|
+
| [picture] | <code>string</code> | | The picture ID to display |
|
|
120
|
+
| [sequence] | <code>string</code> | | The sequence ID of the picture displayed |
|
|
121
|
+
| [fetchOptions] | <code>object</code> | | Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters)) |
|
|
122
|
+
| [users] | <code>Array.<string></code> | <code>[geovisio]</code> | List of users IDs to use for map display (defaults to general map, identified as "geovisio") |
|
|
123
|
+
| [mapstyle] | <code>string</code> \| <code>object</code> | | The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles. |
|
|
124
|
+
| [lang] | <code>string</code> | | To override language used for labels. Defaults to using user's preferred languages. |
|
|
125
|
+
|
|
126
|
+
<a name="Panoramax.components.core.Viewer+onceReady"></a>
|
|
127
|
+
|
|
128
|
+
### viewer.onceReady() ⇒ <code>Promise</code>
|
|
129
|
+
Waits for Viewer to be completely ready (map & PSV loaded, first picture also if one is wanted)
|
|
130
|
+
|
|
131
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
132
|
+
**Overrides**: [<code>onceReady</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+onceReady)
|
|
133
|
+
**Returns**: <code>Promise</code> - When viewer is ready
|
|
134
|
+
<a name="Panoramax.components.core.Viewer+onceMapReady"></a>
|
|
135
|
+
|
|
136
|
+
### viewer.onceMapReady() ⇒ <code>Promise</code>
|
|
137
|
+
Waiting for map to be available.
|
|
138
|
+
|
|
139
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
140
|
+
**Returns**: <code>Promise</code> - When map is ready to use
|
|
141
|
+
<a name="Panoramax.components.core.Viewer+moveCenter"></a>
|
|
142
|
+
|
|
143
|
+
### viewer.moveCenter()
|
|
144
|
+
Move the view of main component to its center.
|
|
145
|
+
For map, center view on selected picture.
|
|
146
|
+
For picture, center view on image center.
|
|
147
|
+
|
|
148
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
149
|
+
**Overrides**: [<code>moveCenter</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+moveCenter)
|
|
150
|
+
<a name="Panoramax.components.core.Viewer+isMapWide"></a>
|
|
151
|
+
|
|
152
|
+
### viewer.isMapWide() ⇒ <code>boolean</code>
|
|
153
|
+
Is the map shown as main element instead of viewer (wide map mode) ?
|
|
154
|
+
|
|
155
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
156
|
+
**Returns**: <code>boolean</code> - True if map is wider than viewer
|
|
157
|
+
<a name="Panoramax.components.core.PhotoViewer+oncePSVReady"></a>
|
|
158
|
+
|
|
159
|
+
### viewer.oncePSVReady() ⇒ <code>Promise</code>
|
|
160
|
+
Waiting for Photo Sphere Viewer to be available.
|
|
161
|
+
|
|
162
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
163
|
+
**Returns**: <code>Promise</code> - When PSV is ready to use
|
|
164
|
+
<a name="Panoramax.components.core.PhotoViewer+onceFirstPicLoaded"></a>
|
|
165
|
+
|
|
166
|
+
### viewer.onceFirstPicLoaded() ⇒ <code>Promise</code>
|
|
167
|
+
Waits for first picture to display on PSV.
|
|
168
|
+
|
|
169
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
170
|
+
**Fulfil**: <code>undefined</code> When picture is shown
|
|
171
|
+
<a name="Panoramax.components.core.PhotoViewer+setPopup"></a>
|
|
172
|
+
|
|
173
|
+
### viewer.setPopup(visible, [content])
|
|
174
|
+
Change full-page popup visibility and content
|
|
175
|
+
|
|
176
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
177
|
+
|
|
178
|
+
| Param | Type | Default | Description |
|
|
179
|
+
| --- | --- | --- | --- |
|
|
180
|
+
| visible | <code>boolean</code> | | True to make it appear |
|
|
181
|
+
| [content] | <code>string</code> \| <code>Array.<Element></code> | <code>null</code> | The new popup content |
|
|
182
|
+
|
|
183
|
+
<a name="Panoramax.components.core.PhotoViewer+moveLeft"></a>
|
|
184
|
+
|
|
185
|
+
### viewer.moveLeft()
|
|
186
|
+
Moves the view of main component slightly to the left.
|
|
187
|
+
|
|
188
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
189
|
+
<a name="Panoramax.components.core.PhotoViewer+moveRight"></a>
|
|
190
|
+
|
|
191
|
+
### viewer.moveRight()
|
|
192
|
+
Moves the view of main component slightly to the right.
|
|
193
|
+
|
|
194
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
195
|
+
<a name="Panoramax.components.core.PhotoViewer+moveUp"></a>
|
|
196
|
+
|
|
197
|
+
### viewer.moveUp()
|
|
198
|
+
Moves the view of main component slightly to the top.
|
|
199
|
+
|
|
200
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
201
|
+
<a name="Panoramax.components.core.PhotoViewer+moveDown"></a>
|
|
202
|
+
|
|
203
|
+
### viewer.moveDown()
|
|
204
|
+
Moves the view of main component slightly to the bottom.
|
|
205
|
+
|
|
206
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
207
|
+
<a name="Panoramax.components.core.PhotoViewer+addEventListener"></a>
|
|
208
|
+
|
|
209
|
+
### viewer.addEventListener(type, listener, [options])
|
|
210
|
+
Listen to events from this components or one of its sub-components.
|
|
211
|
+
|
|
212
|
+
For example, you can listen to `psv` events using prefix `psv:`.
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
me.addEventListener("psv:picture-loading", doSomething);
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
219
|
+
|
|
220
|
+
| Param | Type | Description |
|
|
221
|
+
| --- | --- | --- |
|
|
222
|
+
| type | <code>string</code> | The event type to listen for |
|
|
223
|
+
| listener | <code>function</code> | The event handler |
|
|
224
|
+
| [options] | <code>object</code> | [Any original addEventListener available options](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#options) |
|
|
225
|
+
|
|
226
|
+
<a name="Panoramax.components.core.Basic+onceAPIReady"></a>
|
|
227
|
+
|
|
228
|
+
### viewer.onceAPIReady() ⇒ <code>Promise</code>
|
|
229
|
+
Waits for initial API setup.
|
|
230
|
+
|
|
231
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
232
|
+
**Fulfil**: <code>null</code> When API is ready.
|
|
233
|
+
**Reject**: <code>string</code> Error message
|
|
234
|
+
<a name="Panoramax.components.core.Basic+getClassName"></a>
|
|
235
|
+
|
|
236
|
+
### viewer.getClassName() ⇒ <code>string</code>
|
|
237
|
+
This allows to retrieve an always correct class name.
|
|
238
|
+
This is crap, but avoids issues with Webpack & so on.
|
|
239
|
+
|
|
240
|
+
Each inheriting class must override this method.
|
|
241
|
+
|
|
242
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
243
|
+
**Returns**: <code>string</code> - The class name (for example "Basic")
|
|
244
|
+
<a name="Panoramax.components.core.Basic+select"></a>
|
|
245
|
+
|
|
246
|
+
### viewer.select([seqId], [picId], [force])
|
|
247
|
+
Change the currently picture and/or sequence.
|
|
248
|
+
Calling the method without parameters unselects.
|
|
249
|
+
|
|
250
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
251
|
+
|
|
252
|
+
| Param | Type | Default | Description |
|
|
253
|
+
| --- | --- | --- | --- |
|
|
254
|
+
| [seqId] | <code>string</code> | <code>null</code> | The sequence UUID |
|
|
255
|
+
| [picId] | <code>string</code> | <code>null</code> | The picture UUID |
|
|
256
|
+
| [force] | <code>boolean</code> | <code>false</code> | Force select even if already selected |
|
|
257
|
+
|
|
258
|
+
<a name="Panoramax.components.core.Basic+isWidthSmall"></a>
|
|
259
|
+
|
|
260
|
+
### viewer.isWidthSmall() ⇒ <code>boolean</code>
|
|
261
|
+
Is the view running in a small container (small embed or smartphone)
|
|
262
|
+
|
|
263
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
264
|
+
**Returns**: <code>boolean</code> - True if container is small
|
|
265
|
+
<a name="Panoramax.components.core.Basic+isHeightSmall"></a>
|
|
266
|
+
|
|
267
|
+
### viewer.isHeightSmall() ⇒ <code>boolean</code>
|
|
268
|
+
Is the view running in a small-height container (small embed or smartphone)
|
|
269
|
+
|
|
270
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
271
|
+
**Returns**: <code>boolean</code> - True if container height is small
|
|
272
|
+
<a name="Panoramax.components.core.Basic+getSubComponentsNames"></a>
|
|
273
|
+
|
|
274
|
+
### viewer.getSubComponentsNames() ⇒ <code>Array.<string></code>
|
|
275
|
+
List names of sub-components (like loader, api, map, psv) available in this component.
|
|
276
|
+
|
|
277
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
278
|
+
**Returns**: <code>Array.<string></code> - Sub-components names.
|
|
279
|
+
<a name="Panoramax.components.core.Viewer+event_focus-changed"></a>
|
|
280
|
+
|
|
281
|
+
### "focus-changed"
|
|
282
|
+
Event for focus change (either map or picture is shown wide)
|
|
283
|
+
|
|
284
|
+
**Kind**: event emitted by [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
285
|
+
**Properties**
|
|
286
|
+
|
|
287
|
+
| Name | Type | Description |
|
|
288
|
+
| --- | --- | --- |
|
|
289
|
+
| detail.focus | <code>string</code> | Component now focused on (map, pic) |
|
|
290
|
+
|
|
291
|
+
<a name="Panoramax.components.core.Basic+event_menu-opened"></a>
|
|
292
|
+
|
|
293
|
+
### "menu-opened"
|
|
294
|
+
Event for overlaying menu opening
|
|
295
|
+
|
|
296
|
+
**Kind**: event emitted by [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
297
|
+
**Properties**
|
|
298
|
+
|
|
299
|
+
| Name | Type | Description |
|
|
300
|
+
| --- | --- | --- |
|
|
301
|
+
| detail.menu | <code>Element</code> | The opened menu |
|
|
302
|
+
|
|
303
|
+
<a name="Panoramax.components.core.Basic+event_select"></a>
|
|
304
|
+
|
|
305
|
+
### "select"
|
|
306
|
+
Event for sequence/picture selection
|
|
307
|
+
|
|
308
|
+
**Kind**: event emitted by [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
309
|
+
**Properties**
|
|
310
|
+
|
|
311
|
+
| Name | Type | Description |
|
|
312
|
+
| --- | --- | --- |
|
|
313
|
+
| detail.seqId | <code>string</code> | The selected sequence ID |
|
|
314
|
+
| detail.picId | <code>string</code> | The selected picture ID (or null if not a precise picture clicked) |
|
|
315
|
+
| [detail.prevSeqId] | <code>string</code> | The previously selected sequence ID (or null if none) |
|
|
316
|
+
| [detail.prevPicId] | <code>string</code> | The previously selected picture ID (or null if none) |
|
|
317
|
+
|
|
318
|
+
<a name="Panoramax.components.core.Basic+event_ready"></a>
|
|
319
|
+
|
|
320
|
+
### "ready"
|
|
321
|
+
Event when component is ready to use.
|
|
322
|
+
This happens when loader screen disappear, with picture and map loaded.
|
|
323
|
+
|
|
324
|
+
To follow more precisely loading steps, you can also watch for sub-components `ready` events.
|
|
325
|
+
```js
|
|
326
|
+
// Watch API-readiness
|
|
327
|
+
viewer.addEventListener("api:ready", ...); // From parent
|
|
328
|
+
viewer.api.addEventListener("ready", ...); // Or on sub-component
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
**Kind**: event emitted by [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
332
|
+
<a name="Panoramax.components.core.Basic+event_broken"></a>
|
|
333
|
+
|
|
334
|
+
### "broken"
|
|
335
|
+
Event for viewer failing to initially load.
|
|
336
|
+
|
|
337
|
+
To follow more precisely loading failures, you can also watch for sub-components `broken` events.
|
|
338
|
+
```js
|
|
339
|
+
// Watch API breaks
|
|
340
|
+
viewer.addEventListener("api:broken", ...); // From parent
|
|
341
|
+
viewer.api.addEventListener("broken", ...); // Or on sub-component
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
**Kind**: event emitted by [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
345
|
+
**Properties**
|
|
346
|
+
|
|
347
|
+
| Name | Type | Description |
|
|
348
|
+
| --- | --- | --- |
|
|
349
|
+
| detail.error | <code>string</code> | The user-friendly error message to display |
|
|
350
|
+
|