@panoramax/web-viewer 3.2.3-develop-eb68a0ea → 3.2.3-develop-7a7f14f4
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/CHANGELOG.md +1 -0
- package/build/index.css +1 -1
- package/build/index.css.map +1 -1
- package/build/index.html +1 -1
- package/build/index.js +29 -25
- package/build/index.js.map +1 -1
- package/build/photo.html +1 -0
- package/config/paths.js +1 -0
- package/config/webpack.config.js +26 -0
- package/docs/03_URL_settings.md +4 -1
- package/docs/09_Develop.md +1 -1
- package/docs/images/class_diagram.drawio +37 -22
- package/docs/images/class_diagram.jpg +0 -0
- package/docs/index.md +15 -1
- package/docs/reference/components/core/Basic.md +1 -1
- package/docs/reference/components/core/CoverageMap.md +8 -4
- package/docs/reference/components/core/Editor.md +1 -1
- package/docs/reference/components/core/PhotoViewer.md +256 -0
- package/docs/reference/components/core/Viewer.md +48 -50
- package/docs/reference/components/menus/MapLegend.md +1 -1
- package/docs/reference/components/ui/Photo.md +8 -0
- package/docs/reference/components/ui/widgets/Legend.md +7 -1
- package/docs/reference.md +3 -2
- package/docs/tutorials/custom_widgets.md +6 -11
- package/docs/tutorials/migrate_v4.md +2 -0
- package/mkdocs.yml +1 -0
- package/package.json +1 -1
- package/public/index.html +14 -9
- package/public/photo.html +55 -0
- package/src/components/core/Basic.js +1 -1
- package/src/components/core/CoverageMap.js +24 -3
- package/src/components/core/Editor.js +1 -1
- package/src/components/core/PhotoViewer.css +65 -0
- package/src/components/core/PhotoViewer.js +441 -0
- package/src/components/core/Viewer.js +72 -307
- package/src/components/core/index.js +1 -0
- package/src/components/menus/MapLegend.js +1 -21
- package/src/components/ui/Map.js +1 -17
- package/src/components/ui/Photo.js +13 -3
- package/src/components/ui/widgets/Legend.js +32 -1
- package/src/index.js +1 -0
- package/src/utils/API.js +2 -2
- package/src/utils/InitParameters.js +54 -18
- package/src/utils/URLHandler.js +11 -5
- package/src/utils/map.js +2 -2
- package/tests/components/ui/Photo.test.js +6 -6
- package/tests/utils/InitParameters.test.js +1 -0
- package/tests/utils/URLHandler.test.js +16 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<a name="Panoramax.components.core.Viewer"></a>
|
|
2
2
|
|
|
3
|
-
## Panoramax.components.core.Viewer ⇐ [<code>
|
|
3
|
+
## Panoramax.components.core.Viewer ⇐ [<code>PhotoViewer</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer)
|
|
4
4
|
**Kind**: static class of <code>Panoramax.components.core</code>
|
|
5
|
-
**Extends**: [<code>
|
|
5
|
+
**Extends**: [<code>PhotoViewer</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer)
|
|
6
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
7
|
**Element**: pnx-viewer
|
|
8
8
|
**Slot**: `top-left` The top-left corner
|
|
@@ -17,28 +17,28 @@
|
|
|
17
17
|
| --- | --- | --- |
|
|
18
18
|
| loader | [<code>Loader</code>](../ui/Loader.md/#Panoramax.components.ui.Loader) | The loader screen |
|
|
19
19
|
| api | [<code>API</code>](../../utils/API.md/#Panoramax.utils.API) | The API manager |
|
|
20
|
-
|
|
|
20
|
+
| map | [<code>MapMore</code>](../ui/MapMore.md/#Panoramax.components.ui.MapMore) | The MapLibre GL map itself |
|
|
21
21
|
| psv | [<code>Photo</code>](../ui/Photo.md/#Panoramax.components.ui.Photo) | The Photo Sphere Viewer component itself |
|
|
22
22
|
| grid | [<code>CorneredGrid</code>](../layout/CorneredGrid.md/#Panoramax.components.layout.CorneredGrid) | The grid layout manager |
|
|
23
|
-
|
|
|
23
|
+
| mini | [<code>Mini</code>](../layout/Mini.md/#Panoramax.components.layout.Mini) | The reduced/collapsed map/photo component |
|
|
24
24
|
| popup | [<code>Popup</code>](../ui/Popup.md/#Panoramax.components.ui.Popup) | The popup container |
|
|
25
25
|
| urlHandler | [<code>URLHandler</code>](../../utils/URLHandler.md/#Panoramax.utils.URLHandler) | The URL query parameters manager |
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
* [.Viewer](#Panoramax.components.core.Viewer) ⇐ [<code>
|
|
28
|
+
* [.Viewer](#Panoramax.components.core.Viewer) ⇐ [<code>PhotoViewer</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer)
|
|
29
29
|
* [new Viewer()](#new_Panoramax.components.core.Viewer_new)
|
|
30
30
|
* [.properties](#Panoramax.components.core.Viewer+properties) : <code>Object</code>
|
|
31
31
|
* [.onceReady()](#Panoramax.components.core.Viewer+onceReady) ⇒ <code>Promise</code>
|
|
32
|
-
* [.oncePSVReady()](#Panoramax.components.core.Viewer+oncePSVReady) ⇒ <code>Promise</code>
|
|
33
32
|
* [.onceMapReady()](#Panoramax.components.core.Viewer+onceMapReady) ⇒ <code>Promise</code>
|
|
34
|
-
* [.onceFirstPicLoaded()](#Panoramax.components.core.Viewer+onceFirstPicLoaded) ⇒ <code>Promise</code>
|
|
35
|
-
* [.setPopup(visible, [content])](#Panoramax.components.core.Viewer+setPopup)
|
|
36
33
|
* [.moveCenter()](#Panoramax.components.core.Viewer+moveCenter)
|
|
37
|
-
* [.moveLeft()](#Panoramax.components.core.Viewer+moveLeft)
|
|
38
|
-
* [.moveRight()](#Panoramax.components.core.Viewer+moveRight)
|
|
39
|
-
* [.moveUp()](#Panoramax.components.core.Viewer+moveUp)
|
|
40
|
-
* [.moveDown()](#Panoramax.components.core.Viewer+moveDown)
|
|
41
34
|
* [.isMapWide()](#Panoramax.components.core.Viewer+isMapWide) ⇒ <code>boolean</code>
|
|
35
|
+
* [.oncePSVReady()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+oncePSVReady) ⇒ <code>Promise</code>
|
|
36
|
+
* [.onceFirstPicLoaded()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+onceFirstPicLoaded) ⇒ <code>Promise</code>
|
|
37
|
+
* [.setPopup(visible, [content])](#Panoramax.components.core.PhotoViewer+setPopup)
|
|
38
|
+
* [.moveLeft()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+moveLeft)
|
|
39
|
+
* [.moveRight()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+moveRight)
|
|
40
|
+
* [.moveUp()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+moveUp)
|
|
41
|
+
* [.moveDown()](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+moveDown)
|
|
42
42
|
* [.onceAPIReady()](Basic.md/#Panoramax.components.core.Basic+onceAPIReady) ⇒ <code>Promise</code>
|
|
43
43
|
* [.getClassName()](Basic.md/#Panoramax.components.core.Basic+getClassName) ⇒ <code>string</code>
|
|
44
44
|
* [.select([seqId], [picId], [force])](#Panoramax.components.core.Basic+select)
|
|
@@ -57,6 +57,8 @@ Viewer is the main component of Panoramax JS library, showing pictures and map.
|
|
|
57
57
|
|
|
58
58
|
This component has a [CorneredGrid](../layout/CorneredGrid.md/#Panoramax.components.layout.CorneredGrid) layout, you can use directly any slot element to pass custom widgets.
|
|
59
59
|
|
|
60
|
+
If you need a viewer without map, checkout [Photo Viewer component](PhotoViewer.md/#Panoramax.components.core.PhotoViewer).
|
|
61
|
+
|
|
60
62
|
**Example**
|
|
61
63
|
```html
|
|
62
64
|
<!-- Basic example -->
|
|
@@ -75,7 +77,6 @@ This component has a [CorneredGrid](../layout/CorneredGrid.md/#Panoramax.compone
|
|
|
75
77
|
<pnx-viewer
|
|
76
78
|
endpoint="https://panoramax.openstreetmap.fr/"
|
|
77
79
|
widgets="false"
|
|
78
|
-
map="false"
|
|
79
80
|
>
|
|
80
81
|
<p slot="top-right">My custom text</p>
|
|
81
82
|
</pnx-viewer>
|
|
@@ -92,13 +93,14 @@ This component has a [CorneredGrid](../layout/CorneredGrid.md/#Panoramax.compone
|
|
|
92
93
|
Component properties. All of [Basic properties](Basic.md/#Panoramax.components.core.Basic+properties) are available as well.
|
|
93
94
|
|
|
94
95
|
**Kind**: instance property of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
95
|
-
**Mixes**: [<code>properties</code>](
|
|
96
|
-
**Overrides**: [<code>properties</code>](
|
|
96
|
+
**Mixes**: [<code>properties</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+properties)
|
|
97
|
+
**Overrides**: [<code>properties</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+properties)
|
|
97
98
|
**Properties**
|
|
98
99
|
|
|
99
100
|
| Name | Type | Default | Description |
|
|
100
101
|
| --- | --- | --- | --- |
|
|
101
|
-
|
|
|
102
|
+
| 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)) |
|
|
103
|
+
| [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'}"` |
|
|
102
104
|
| [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'}"` |
|
|
103
105
|
| [url-parameters] | <code>string</code> | <code>true</code> | Should the component add and update URL query parameters to save viewer state ? |
|
|
104
106
|
| [focus] | <code>string</code> | <code>"pic"</code> | The component showing up as main component (pic, map) |
|
|
@@ -110,7 +112,6 @@ Component properties. All of [Basic properties](Basic.md/#Panoramax.components.c
|
|
|
110
112
|
| [users] | <code>Array.<string></code> | <code>[geovisio]</code> | List of users IDs to use for map display (defaults to general map, identified as "geovisio") |
|
|
111
113
|
| [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. |
|
|
112
114
|
| [lang] | <code>string</code> | | To override language used for labels. Defaults to using user's preferred languages. |
|
|
113
|
-
| 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)) |
|
|
114
115
|
|
|
115
116
|
<a name="Panoramax.components.core.Viewer+onceReady"></a>
|
|
116
117
|
|
|
@@ -118,15 +119,8 @@ Component properties. All of [Basic properties](Basic.md/#Panoramax.components.c
|
|
|
118
119
|
Waits for Viewer to be completely ready (map & PSV loaded, first picture also if one is wanted)
|
|
119
120
|
|
|
120
121
|
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
121
|
-
**Overrides**: [<code>onceReady</code>](
|
|
122
|
+
**Overrides**: [<code>onceReady</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+onceReady)
|
|
122
123
|
**Returns**: <code>Promise</code> - When viewer is ready
|
|
123
|
-
<a name="Panoramax.components.core.Viewer+oncePSVReady"></a>
|
|
124
|
-
|
|
125
|
-
### viewer.oncePSVReady() ⇒ <code>Promise</code>
|
|
126
|
-
Waiting for Photo Sphere Viewer to be available.
|
|
127
|
-
|
|
128
|
-
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
129
|
-
**Returns**: <code>Promise</code> - When PSV is ready to use
|
|
130
124
|
<a name="Panoramax.components.core.Viewer+onceMapReady"></a>
|
|
131
125
|
|
|
132
126
|
### viewer.onceMapReady() ⇒ <code>Promise</code>
|
|
@@ -134,14 +128,37 @@ Waiting for map to be available.
|
|
|
134
128
|
|
|
135
129
|
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
136
130
|
**Returns**: <code>Promise</code> - When map is ready to use
|
|
137
|
-
<a name="Panoramax.components.core.Viewer+
|
|
131
|
+
<a name="Panoramax.components.core.Viewer+moveCenter"></a>
|
|
132
|
+
|
|
133
|
+
### viewer.moveCenter()
|
|
134
|
+
Move the view of main component to its center.
|
|
135
|
+
For map, center view on selected picture.
|
|
136
|
+
For picture, center view on image center.
|
|
137
|
+
|
|
138
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
139
|
+
**Overrides**: [<code>moveCenter</code>](PhotoViewer.md/#Panoramax.components.core.PhotoViewer+moveCenter)
|
|
140
|
+
<a name="Panoramax.components.core.Viewer+isMapWide"></a>
|
|
141
|
+
|
|
142
|
+
### viewer.isMapWide() ⇒ <code>boolean</code>
|
|
143
|
+
Is the map shown as main element instead of viewer (wide map mode) ?
|
|
144
|
+
|
|
145
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
146
|
+
**Returns**: <code>boolean</code> - True if map is wider than viewer
|
|
147
|
+
<a name="Panoramax.components.core.PhotoViewer+oncePSVReady"></a>
|
|
148
|
+
|
|
149
|
+
### viewer.oncePSVReady() ⇒ <code>Promise</code>
|
|
150
|
+
Waiting for Photo Sphere Viewer to be available.
|
|
151
|
+
|
|
152
|
+
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
153
|
+
**Returns**: <code>Promise</code> - When PSV is ready to use
|
|
154
|
+
<a name="Panoramax.components.core.PhotoViewer+onceFirstPicLoaded"></a>
|
|
138
155
|
|
|
139
156
|
### viewer.onceFirstPicLoaded() ⇒ <code>Promise</code>
|
|
140
157
|
Waits for first picture to display on PSV.
|
|
141
158
|
|
|
142
159
|
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
143
160
|
**Fulfil**: <code>undefined</code> When picture is shown
|
|
144
|
-
<a name="Panoramax.components.core.
|
|
161
|
+
<a name="Panoramax.components.core.PhotoViewer+setPopup"></a>
|
|
145
162
|
|
|
146
163
|
### viewer.setPopup(visible, [content])
|
|
147
164
|
Change full-page popup visibility and content
|
|
@@ -153,49 +170,30 @@ Change full-page popup visibility and content
|
|
|
153
170
|
| visible | <code>boolean</code> | | True to make it appear |
|
|
154
171
|
| [content] | <code>string</code> \| <code>Array.<Element></code> | <code>null</code> | The new popup content |
|
|
155
172
|
|
|
156
|
-
<a name="Panoramax.components.core.
|
|
157
|
-
|
|
158
|
-
### viewer.moveCenter()
|
|
159
|
-
Move the view of main component to its center.
|
|
160
|
-
For map, center view on selected picture.
|
|
161
|
-
For picture, center view on image center.
|
|
162
|
-
|
|
163
|
-
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
164
|
-
<a name="Panoramax.components.core.Viewer+moveLeft"></a>
|
|
173
|
+
<a name="Panoramax.components.core.PhotoViewer+moveLeft"></a>
|
|
165
174
|
|
|
166
175
|
### viewer.moveLeft()
|
|
167
176
|
Moves the view of main component slightly to the left.
|
|
168
177
|
|
|
169
178
|
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
170
|
-
<a name="Panoramax.components.core.
|
|
179
|
+
<a name="Panoramax.components.core.PhotoViewer+moveRight"></a>
|
|
171
180
|
|
|
172
181
|
### viewer.moveRight()
|
|
173
182
|
Moves the view of main component slightly to the right.
|
|
174
183
|
|
|
175
184
|
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
176
|
-
<a name="Panoramax.components.core.
|
|
185
|
+
<a name="Panoramax.components.core.PhotoViewer+moveUp"></a>
|
|
177
186
|
|
|
178
187
|
### viewer.moveUp()
|
|
179
188
|
Moves the view of main component slightly to the top.
|
|
180
189
|
|
|
181
190
|
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
182
|
-
<a name="Panoramax.components.core.
|
|
191
|
+
<a name="Panoramax.components.core.PhotoViewer+moveDown"></a>
|
|
183
192
|
|
|
184
193
|
### viewer.moveDown()
|
|
185
194
|
Moves the view of main component slightly to the bottom.
|
|
186
195
|
|
|
187
196
|
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
188
|
-
<a name="Panoramax.components.core.Viewer+isMapWide"></a>
|
|
189
|
-
|
|
190
|
-
### viewer.isMapWide() ⇒ <code>boolean</code>
|
|
191
|
-
Is the map shown as main element instead of viewer (wide map mode) ?
|
|
192
|
-
|
|
193
|
-
**Kind**: instance method of [<code>Viewer</code>](#Panoramax.components.core.Viewer)
|
|
194
|
-
**Returns**: <code>boolean</code> - True if map is wider than viewer
|
|
195
|
-
**Throws**:
|
|
196
|
-
|
|
197
|
-
- <code>Error</code> If map is not enabled
|
|
198
|
-
|
|
199
197
|
<a name="Panoramax.components.core.Basic+onceAPIReady"></a>
|
|
200
198
|
|
|
201
199
|
### viewer.onceAPIReady() ⇒ <code>Promise</code>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* [.Photo](#Panoramax.components.ui.Photo) ⇐ <code>[photo-sphere-viewer.core.Viewer](https://photo-sphere-viewer.js.org/api/classes/Core.Viewer.html)</code>
|
|
9
9
|
* [new Photo(parent, container, [options])](#new_Panoramax.components.ui.Photo_new)
|
|
10
10
|
* [.getPictureMetadata()](#Panoramax.components.ui.Photo+getPictureMetadata) ⇒ <code>object</code>
|
|
11
|
+
* [.getPictureId()](#Panoramax.components.ui.Photo+getPictureId) ⇒ <code>string</code> \| <code>null</code>
|
|
11
12
|
* [.goToNextPicture()](#Panoramax.components.ui.Photo+goToNextPicture)
|
|
12
13
|
* [.goToPrevPicture()](#Panoramax.components.ui.Photo+goToPrevPicture)
|
|
13
14
|
* [.goToPosition(lat, lon)](#Panoramax.components.ui.Photo+goToPosition) ⇒ <code>Promise</code>
|
|
@@ -69,6 +70,13 @@ Access currently shown picture metadata
|
|
|
69
70
|
|
|
70
71
|
**Kind**: instance method of [<code>Photo</code>](#Panoramax.components.ui.Photo)
|
|
71
72
|
**Returns**: <code>object</code> - Picture metadata
|
|
73
|
+
<a name="Panoramax.components.ui.Photo+getPictureId"></a>
|
|
74
|
+
|
|
75
|
+
### photo.getPictureId() ⇒ <code>string</code> \| <code>null</code>
|
|
76
|
+
Get current picture ID, or loading picture ID if any.
|
|
77
|
+
|
|
78
|
+
**Kind**: instance method of [<code>Photo</code>](#Panoramax.components.ui.Photo)
|
|
79
|
+
**Returns**: <code>string</code> \| <code>null</code> - Picture ID (current or loading), or null if none is selected.
|
|
72
80
|
<a name="Panoramax.components.ui.Photo+goToNextPicture"></a>
|
|
73
81
|
|
|
74
82
|
### photo.goToNextPicture()
|
|
@@ -13,10 +13,15 @@
|
|
|
13
13
|
|
|
14
14
|
### new Legend()
|
|
15
15
|
Legend widget, handling switch between map and photo components.
|
|
16
|
+
Also displays a default "About Panoramax" message.
|
|
16
17
|
|
|
17
18
|
**Example**
|
|
18
19
|
```html
|
|
19
|
-
<pnx-widget-legend
|
|
20
|
+
<pnx-widget-legend
|
|
21
|
+
_parent=${viewer}
|
|
22
|
+
focus="map"
|
|
23
|
+
picture="PICTURE-ID-IF-ANY"
|
|
24
|
+
/>
|
|
20
25
|
```
|
|
21
26
|
<a name="Panoramax.components.ui.widgets.Legend+properties"></a>
|
|
22
27
|
|
|
@@ -29,4 +34,5 @@ Component properties.
|
|
|
29
34
|
| Name | Type | Description |
|
|
30
35
|
| --- | --- | --- |
|
|
31
36
|
| [focus] | <code>string</code> | The focused main component (map, pic) |
|
|
37
|
+
| [picture] | <code>string</code> | The picture ID |
|
|
32
38
|
|
package/docs/reference.md
CHANGED
|
@@ -8,8 +8,9 @@ Main web components:
|
|
|
8
8
|
|
|
9
9
|
- [Basic](./reference/components/core/Basic.md) : base class for other components, embedding shared logic.
|
|
10
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
|
-
- [
|
|
11
|
+
- [Editor](./reference/components/core/Editor.md) : photo and map display for editing purposes.7
|
|
12
|
+
- [PhotoViewer](./reference/components/core/PhotoViewer.md) : the classic photo-only viewer.
|
|
13
|
+
- [Viewer](./reference/components/core/Viewer.md) : the photo and map viewer.
|
|
13
14
|
|
|
14
15
|
## `components.layout`
|
|
15
16
|
|
|
@@ -6,7 +6,7 @@ We use internally [slots](https://developer.mozilla.org/docs/Web/HTML/Element/sl
|
|
|
6
6
|
|
|
7
7
|
!!! note
|
|
8
8
|
|
|
9
|
-
This is only available for __Viewer__
|
|
9
|
+
This is only available for __Viewer__ & __Photo Viewer__ components, not for _Coverage Map_ or _Editor_.
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
## Add a new widget
|
|
@@ -36,17 +36,12 @@ For finer control, you may want to get rid of all existing widgets before adding
|
|
|
36
36
|
</pnx-viewer>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
Note that this keeps only the _Mini_ map/picture display (in bottom-left corner)
|
|
39
|
+
Note that this keeps only the _Mini_ map/picture display (in bottom-left corner).
|
|
40
|
+
|
|
41
|
+
!!! note
|
|
42
|
+
|
|
43
|
+
If you don't need map at all, you can also use the [Photo Viewer](../reference/components/core/PhotoViewer.md) component, which is a picture display without any map.
|
|
40
44
|
|
|
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
45
|
|
|
51
46
|
## Reuse default widgets
|
|
52
47
|
|
|
@@ -66,6 +66,8 @@ Many stuff was moved around, and have a bit different naming. Main classes shoul
|
|
|
66
66
|
| `Panoramax.Editor` | `<pnx-editor>` |
|
|
67
67
|
| `Panoramax.StandaloneMap` | `<pnx-coverage-map>` |
|
|
68
68
|
|
|
69
|
+
A new main component is available, named __Photo Viewer__ (`<pnx-photo-viewer>`) for showing up only picture (without map).
|
|
70
|
+
|
|
69
71
|
And source code is splitted in more packages:
|
|
70
72
|
|
|
71
73
|
* `Panoramax.components` : everything you can see graphically
|
package/mkdocs.yml
CHANGED
|
@@ -57,6 +57,7 @@ nav:
|
|
|
57
57
|
- Basic: 'reference/components/core/Basic.md'
|
|
58
58
|
- CoverageMap: 'reference/components/core/CoverageMap.md'
|
|
59
59
|
- Editor: 'reference/components/core/Editor.md'
|
|
60
|
+
- PhotoViewer: 'reference/components/core/PhotoViewer.md'
|
|
60
61
|
- Viewer: 'reference/components/core/Viewer.md'
|
|
61
62
|
- layout:
|
|
62
63
|
- CorneredGrid: 'reference/components/layout/CorneredGrid.md'
|
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -18,9 +18,8 @@
|
|
|
18
18
|
}
|
|
19
19
|
.oneView {
|
|
20
20
|
text-align: center;
|
|
21
|
-
flex
|
|
22
|
-
|
|
23
|
-
min-width: 30%;
|
|
21
|
+
flex: 1;
|
|
22
|
+
min-width: 400px;
|
|
24
23
|
}
|
|
25
24
|
iframe {
|
|
26
25
|
width: 100%;
|
|
@@ -38,20 +37,26 @@
|
|
|
38
37
|
|
|
39
38
|
<div class="allViews">
|
|
40
39
|
<div class="oneView">
|
|
41
|
-
<h2
|
|
42
|
-
<p>General-purpose map and picture display.<br /><a href="./viewer.html">Full page</a> | <a href="https://
|
|
40
|
+
<h2>Viewer</h2>
|
|
41
|
+
<p>General-purpose map and picture display.<br /><a href="./viewer.html">Full page</a> | <a href="https://viewer.geovisio.fr/docs/reference/components/core/Viewer/">Docs</a></p>
|
|
43
42
|
<iframe src="./viewer.html?server=meta"></iframe>
|
|
44
43
|
</div>
|
|
45
44
|
|
|
46
45
|
<div class="oneView">
|
|
47
|
-
<h2
|
|
48
|
-
<p>
|
|
46
|
+
<h2>Photo Viewer</h2>
|
|
47
|
+
<p>Picture-only display.<br /><a href="./photo.html">Full page</a> | <a href="https://viewer.geovisio.fr/docs/reference/components/core/PhotoViewer/">Docs</a></p>
|
|
48
|
+
<iframe src="./photo.html?server=meta"></iframe>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div class="oneView">
|
|
52
|
+
<h2>Coverage Map</h2>
|
|
53
|
+
<p>A map-only view, to locate sequences and pictures.<br /><a href="./map.html">Full page</a> | <a href="https://viewer.geovisio.fr/docs/reference/components/core/CoverageMap/">Docs</a></p>
|
|
49
54
|
<iframe src="./map.html"></iframe>
|
|
50
55
|
</div>
|
|
51
56
|
|
|
52
57
|
<div class="oneView">
|
|
53
|
-
<h2
|
|
54
|
-
<p>A map and picture view, focused around metadata editing.<br /><a href="./editor.html">Full page</a> | <a href="https://
|
|
58
|
+
<h2>Editor</h2>
|
|
59
|
+
<p>A map and picture view, focused around metadata editing.<br /><a href="./editor.html">Full page</a> | <a href="https://viewer.geovisio.fr/docs/reference/components/core/Editor/">Docs</a></p>
|
|
55
60
|
<iframe src="./editor.html"></iframe>
|
|
56
61
|
</div>
|
|
57
62
|
</div>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
6
|
+
<title>Panoramax Photo Viewer</title>
|
|
7
|
+
<style>
|
|
8
|
+
#viewer {
|
|
9
|
+
position: relative;
|
|
10
|
+
width: 95%;
|
|
11
|
+
margin: 2.5%;
|
|
12
|
+
height: 400px;
|
|
13
|
+
}
|
|
14
|
+
#viewer.fullpage {
|
|
15
|
+
position: fixed;
|
|
16
|
+
top: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
height: unset;
|
|
21
|
+
width: unset;
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
25
|
+
</head>
|
|
26
|
+
<body>
|
|
27
|
+
<noscript>
|
|
28
|
+
You need to enable JavaScript to run this app.
|
|
29
|
+
</noscript>
|
|
30
|
+
|
|
31
|
+
<pnx-photo-viewer
|
|
32
|
+
id="viewer"
|
|
33
|
+
class="fullpage"
|
|
34
|
+
sequence="ecfe4b2c-0acd-4d3a-a10d-c3e6818755c8"
|
|
35
|
+
picture="329af5c6-4761-4a6d-9c1e-674fd6daa8b6"
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
var servers = {
|
|
40
|
+
meta: "https://api.panoramax.xyz/api",
|
|
41
|
+
ign: "https://panoramax.ign.fr/api",
|
|
42
|
+
osm: "https://panoramax.openstreetmap.fr/api",
|
|
43
|
+
local: "http://localhost:5000/api",
|
|
44
|
+
dev: "https://panoramax.codeureusesenliberte.fr/api",
|
|
45
|
+
};
|
|
46
|
+
var urlParams = new URLSearchParams(window.location.search);
|
|
47
|
+
var server = servers[urlParams.get("server") || "meta"];
|
|
48
|
+
|
|
49
|
+
window.onload = () => {
|
|
50
|
+
var viewer = document.getElementById("viewer");
|
|
51
|
+
viewer.setAttribute("endpoint", server);
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
</body>
|
|
55
|
+
</html>
|
|
@@ -33,13 +33,13 @@ export default class Basic extends LitElement {
|
|
|
33
33
|
* @memberof Panoramax.components.core.Basic#
|
|
34
34
|
* @type {Object}
|
|
35
35
|
* @mixin
|
|
36
|
+
* @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))
|
|
36
37
|
* @property {string} [picture] The picture ID to display
|
|
37
38
|
* @property {string} [sequence] The sequence ID of the picture displayed
|
|
38
39
|
* @property {object} [fetchOptions] 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))
|
|
39
40
|
* @property {string[]} [users=[geovisio]] List of users IDs to use for map display (defaults to general map, identified as "geovisio")
|
|
40
41
|
* @property {string|object} [mapstyle] 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.
|
|
41
42
|
* @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.
|
|
42
|
-
* @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))
|
|
43
43
|
*/
|
|
44
44
|
static properties = {
|
|
45
45
|
picture: {type: String, reflect: true},
|
|
@@ -3,6 +3,7 @@ import Map from "../ui/Map";
|
|
|
3
3
|
import { getUserLayerId } from "../../utils/map";
|
|
4
4
|
import { NavigationControl } from "!maplibre-gl"; // DO NOT REMOVE THE "!": bundled builds breaks otherwise !!!
|
|
5
5
|
import "./CoverageMap.css";
|
|
6
|
+
import { default as InitParameters, alterMapState } from "../../utils/InitParameters";
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -20,16 +21,37 @@ import "./CoverageMap.css";
|
|
|
20
21
|
* ```html
|
|
21
22
|
* <pnx-coverage-map
|
|
22
23
|
* endpoint="https://panoramax.openstreetmap.fr/"
|
|
24
|
+
* map='{"bounds": [[-73.9876, 40.7661], [-73.9397, 40.8002]]}'
|
|
23
25
|
* />
|
|
24
26
|
* ```
|
|
25
27
|
*/
|
|
26
28
|
export default class CoverageMap extends Basic {
|
|
29
|
+
/**
|
|
30
|
+
* Component properties.
|
|
31
|
+
* @memberof Panoramax.components.core.CoverageMap#
|
|
32
|
+
* @type {Object}
|
|
33
|
+
* @mixes Panoramax.components.core.Basic#properties
|
|
34
|
+
* @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))
|
|
35
|
+
* @property {string} [picture] The picture ID to display
|
|
36
|
+
* @property {string} [sequence] The sequence ID of the picture displayed
|
|
37
|
+
* @property {object} [fetchOptions] 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))
|
|
38
|
+
* @property {string[]} [users=[geovisio]] List of users IDs to use for map display (defaults to general map, identified as "geovisio")
|
|
39
|
+
* @property {string|object} [mapstyle] 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.
|
|
40
|
+
* @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.
|
|
41
|
+
* @property {object} [map] [Any map option available in Map class](#Panoramax.components.ui.Map).<br />Example: `map='{"bounds": [[-73.9876, 40.7661], [-73.9397, 40.8002]]}'`
|
|
42
|
+
*/
|
|
43
|
+
static properties = {
|
|
44
|
+
map: {type: Object},
|
|
45
|
+
...Basic.properties
|
|
46
|
+
};
|
|
47
|
+
|
|
27
48
|
constructor() {
|
|
28
49
|
super();
|
|
29
50
|
|
|
30
51
|
this._mapContainer = document.createElement("div");
|
|
31
52
|
this.onceAPIReady().then(() => {
|
|
32
53
|
this.loader.setAttribute("value", 30);
|
|
54
|
+
this._initParams = new InitParameters(InitParameters.GetComponentProperties(CoverageMap, this));
|
|
33
55
|
this._initMap();
|
|
34
56
|
});
|
|
35
57
|
|
|
@@ -60,8 +82,6 @@ export default class CoverageMap extends Basic {
|
|
|
60
82
|
* @private
|
|
61
83
|
*/
|
|
62
84
|
_initMap() {
|
|
63
|
-
const mapOptions = { hash: true };
|
|
64
|
-
|
|
65
85
|
// Override to avoid display of pictures symbols
|
|
66
86
|
class MyMap extends Map {
|
|
67
87
|
_getLayerStyleProperties(layer) {
|
|
@@ -74,10 +94,11 @@ export default class CoverageMap extends Basic {
|
|
|
74
94
|
}
|
|
75
95
|
}
|
|
76
96
|
|
|
77
|
-
this.map = new MyMap(this, this._mapContainer,
|
|
97
|
+
this.map = new MyMap(this, this._mapContainer, Object.assign({}, this._initParams.getMapInit(), { hash: true }));
|
|
78
98
|
this.map.addControl(new NavigationControl({ showCompass: false }));
|
|
79
99
|
this.loader.setAttribute("value", 70);
|
|
80
100
|
this.map.waitForEnoughMapLoaded().then(() => {
|
|
101
|
+
alterMapState(this.map, this._initParams.getMapPostInit());
|
|
81
102
|
this.map.reloadLayersStyles();
|
|
82
103
|
this.loader.dismiss();
|
|
83
104
|
});
|
|
@@ -40,13 +40,13 @@ export default class Editor extends Basic {
|
|
|
40
40
|
* @memberof Panoramax.components.core.Editor#
|
|
41
41
|
* @mixes Panoramax.components.core.Basic#properties
|
|
42
42
|
* @type {Object}
|
|
43
|
+
* @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))
|
|
43
44
|
* @property {string} [picture] The picture ID to display
|
|
44
45
|
* @property {string} [sequence] The sequence ID of the picture displayed
|
|
45
46
|
* @property {object} [fetchOptions] 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))
|
|
46
47
|
* @property {string[]} [users=[geovisio]] List of users IDs to use for map display (defaults to general map, identified as "geovisio")
|
|
47
48
|
* @property {string|object} [mapstyle] 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.
|
|
48
49
|
* @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.
|
|
49
|
-
* @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))
|
|
50
50
|
* @property {object} [raster] The MapLibre raster source for aerial background. This must be a JSON object following [MapLibre raster source definition](https://maplibre.org/maplibre-style-spec/sources/#raster).
|
|
51
51
|
* @property {string} [background=streets] Choose default map background to display (streets or aerial, if raster aerial background available). Defaults to street.
|
|
52
52
|
*/
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* Maximized components */
|
|
2
|
+
pnx-photo-viewer .pnx-psv {
|
|
3
|
+
position: absolute;
|
|
4
|
+
inset: 0;
|
|
5
|
+
z-index: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* No PSV loader */
|
|
9
|
+
pnx-photo-viewer .psv-loader {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Cornered grid layout */
|
|
14
|
+
pnx-photo-viewer pnx-cornered-grid::part(corner-top-left),
|
|
15
|
+
pnx-photo-viewer pnx-cornered-grid::part(corner-top),
|
|
16
|
+
pnx-photo-viewer pnx-cornered-grid::part(corner-top-right),
|
|
17
|
+
pnx-photo-viewer pnx-cornered-grid::part(corner-bottom-left),
|
|
18
|
+
pnx-photo-viewer pnx-cornered-grid::part(corner-bottom),
|
|
19
|
+
pnx-photo-viewer pnx-cornered-grid::part(corner-bottom-right) {
|
|
20
|
+
gap: 10px;
|
|
21
|
+
padding: 10px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@media screen and (max-width: 576px) {
|
|
25
|
+
pnx-photo-viewer pnx-cornered-grid::part(corner-top-right) {
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: flex-end;
|
|
28
|
+
justify-content: flex-start;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Override legend positioning */
|
|
33
|
+
@media screen and (max-width: 576px) {
|
|
34
|
+
pnx-photo-viewer pnx-widget-legend {
|
|
35
|
+
position: fixed;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
right: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
pnx-photo-viewer pnx-widget-legend::part(panel) {
|
|
42
|
+
border-radius: 0;
|
|
43
|
+
border-top: none;
|
|
44
|
+
border-left: none;
|
|
45
|
+
border-right: none;
|
|
46
|
+
width: unset;
|
|
47
|
+
max-width: unset;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
pnx-photo-viewer pnx-widget-player {
|
|
51
|
+
margin-top: 60px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media screen and (min-width: 576px) {
|
|
56
|
+
pnx-photo-viewer pnx-widget-legend {
|
|
57
|
+
position: absolute;
|
|
58
|
+
left: 10px;
|
|
59
|
+
top: 60px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
pnx-photo-viewer pnx-widget-legend {
|
|
63
|
+
top: 10px;
|
|
64
|
+
}
|
|
65
|
+
}
|