@panoramax/web-viewer 5.0.0-develop-d26305dd → 5.0.0-develop-be5ba1a7
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/build/cjs/index.js +1 -1
- package/build/cjs/index_photoviewer.js +1 -1
- package/build/esm/components/core/Basic.js +1 -1
- package/build/esm/translations/el.json +92 -1
- package/package.json +1 -1
- package/build/bundle.cjs +0 -3399
- package/build/bundle.cjs.map +0 -1
- package/build/bundle_photoviewer.cjs +0 -2510
- package/build/bundle_photoviewer.cjs.map +0 -1
- package/build/components/core/Basic.css +0 -56
- package/build/components/core/Basic.js +0 -378
- package/build/components/core/CoverageMap.css +0 -10
- package/build/components/core/CoverageMap.js +0 -169
- package/build/components/core/Editor.css +0 -33
- package/build/components/core/Editor.js +0 -398
- package/build/components/core/PhotoViewer.css +0 -70
- package/build/components/core/PhotoViewer.js +0 -650
- package/build/components/core/Viewer.css +0 -130
- package/build/components/core/Viewer.js +0 -711
- package/build/components/core/index.js +0 -10
- package/build/components/index.js +0 -11
- package/build/components/index_photoviewer.js +0 -6
- package/build/components/layout/BottomDrawer.js +0 -258
- package/build/components/layout/CorneredGrid.js +0 -143
- package/build/components/layout/Mini.js +0 -121
- package/build/components/layout/Tabs.js +0 -140
- package/build/components/layout/index.js +0 -9
- package/build/components/menus/LocationPrecisionDoc.js +0 -42
- package/build/components/menus/MapBackground.js +0 -110
- package/build/components/menus/MapFilters.js +0 -567
- package/build/components/menus/MapLayers.js +0 -238
- package/build/components/menus/MapLegend.js +0 -68
- package/build/components/menus/MiniPictureLegend.js +0 -73
- package/build/components/menus/PictureLegend.js +0 -379
- package/build/components/menus/PictureMetadata.js +0 -380
- package/build/components/menus/PlayerOptions.js +0 -93
- package/build/components/menus/QualityScoreDoc.js +0 -42
- package/build/components/menus/ReportForm.js +0 -132
- package/build/components/menus/SemanticsDoc.js +0 -38
- package/build/components/menus/SemanticsDownload.js +0 -33
- package/build/components/menus/SemanticsFilters.js +0 -153
- package/build/components/menus/SemanticsList.js +0 -413
- package/build/components/menus/SemanticsMetadata.js +0 -368
- package/build/components/menus/Share.js +0 -105
- package/build/components/menus/index.js +0 -22
- package/build/components/menus/index_photoviewer.js +0 -11
- package/build/components/styles.js +0 -557
- package/build/components/ui/AnnotationsSwitch.js +0 -159
- package/build/components/ui/Button.js +0 -77
- package/build/components/ui/ButtonGroup.css +0 -59
- package/build/components/ui/ButtonGroup.js +0 -69
- package/build/components/ui/CopyButton.js +0 -110
- package/build/components/ui/Grade.js +0 -54
- package/build/components/ui/GradeFilter.js +0 -122
- package/build/components/ui/IconSwitch.js +0 -193
- package/build/components/ui/LinkButton.js +0 -67
- package/build/components/ui/ListGroup.js +0 -66
- package/build/components/ui/ListItem.js +0 -90
- package/build/components/ui/Loader.js +0 -203
- package/build/components/ui/Map.css +0 -63
- package/build/components/ui/Map.js +0 -853
- package/build/components/ui/MapMore.js +0 -175
- package/build/components/ui/Photo.css +0 -50
- package/build/components/ui/Photo.js +0 -1502
- package/build/components/ui/Popup.js +0 -145
- package/build/components/ui/ProgressBar.js +0 -104
- package/build/components/ui/QualityScore.js +0 -147
- package/build/components/ui/SearchBar.js +0 -374
- package/build/components/ui/SemanticsEditor.js +0 -191
- package/build/components/ui/SemanticsTable.js +0 -88
- package/build/components/ui/Switch.js +0 -139
- package/build/components/ui/TogglableGroup.js +0 -157
- package/build/components/ui/index.js +0 -29
- package/build/components/ui/index_photoviewer.js +0 -21
- package/build/components/ui/widgets/CopyCoordinates.js +0 -75
- package/build/components/ui/widgets/GeoSearch.css +0 -21
- package/build/components/ui/widgets/GeoSearch.js +0 -150
- package/build/components/ui/widgets/Legend.js +0 -190
- package/build/components/ui/widgets/LevelSelect.css +0 -51
- package/build/components/ui/widgets/LevelSelect.js +0 -143
- package/build/components/ui/widgets/MapFiltersButton.js +0 -114
- package/build/components/ui/widgets/MapLayersButton.js +0 -79
- package/build/components/ui/widgets/OSMEditors.js +0 -155
- package/build/components/ui/widgets/PictureLegendActions.js +0 -99
- package/build/components/ui/widgets/Player.css +0 -7
- package/build/components/ui/widgets/Player.js +0 -154
- package/build/components/ui/widgets/SemanticsFiltersButton.js +0 -65
- package/build/components/ui/widgets/Zoom.js +0 -84
- package/build/components/ui/widgets/index.js +0 -16
- package/build/components/ui/widgets/index_photoviewer.js +0 -7
- package/build/img/arrow_360.svg +0 -14
- package/build/img/arrow_flat.svg +0 -11
- package/build/img/arrow_triangle.svg +0 -9
- package/build/img/arrow_turn.svg +0 -8
- package/build/img/bg_aerial.jpg +0 -0
- package/build/img/bg_streets.jpg +0 -0
- package/build/img/loader_base.jpg +0 -0
- package/build/img/logo_dead.svg +0 -91
- package/build/img/marker.svg +0 -17
- package/build/img/marker_blue.svg +0 -20
- package/build/img/osm.svg +0 -49
- package/build/img/panoramax.svg +0 -13
- package/build/img/switch_big.svg +0 -54
- package/build/img/switch_mini.svg +0 -48
- package/build/img/wd.svg +0 -1
- package/build/index_photoviewer.js +0 -4
- package/build/package.json +0 -148
- package/build/servers.js +0 -14
- package/build/translations/ar.json +0 -1
- package/build/translations/be.json +0 -257
- package/build/translations/br.json +0 -81
- package/build/translations/cy.json +0 -117
- package/build/translations/da.json +0 -300
- package/build/translations/de.json +0 -309
- package/build/translations/en.json +0 -294
- package/build/translations/eo.json +0 -235
- package/build/translations/es.json +0 -292
- package/build/translations/fi.json +0 -1
- package/build/translations/fr.json +0 -294
- package/build/translations/hr.json +0 -294
- package/build/translations/hu.json +0 -294
- package/build/translations/it.json +0 -306
- package/build/translations/ja.json +0 -182
- package/build/translations/ko.json +0 -1
- package/build/translations/nl.json +0 -305
- package/build/translations/nn.json +0 -1
- package/build/translations/pl.json +0 -169
- package/build/translations/pt.json +0 -296
- package/build/translations/pt_BR.json +0 -304
- package/build/translations/sv.json +0 -182
- package/build/translations/ti.json +0 -9
- package/build/translations/tr.json +0 -297
- package/build/translations/uk.json +0 -268
- package/build/translations/zh_Hant.json +0 -309
- package/build/utils/API.js +0 -928
- package/build/utils/InitParameters.js +0 -521
- package/build/utils/MapStyleComposer.js +0 -889
- package/build/utils/PanoraMapProtocol.js +0 -49
- package/build/utils/PhotoAdapter.js +0 -49
- package/build/utils/PresetsManager.js +0 -148
- package/build/utils/SemanticsMapProtocol.js +0 -144
- package/build/utils/URLHandler.js +0 -426
- package/build/utils/geocoder.js +0 -203
- package/build/utils/i18n.js +0 -128
- package/build/utils/index.js +0 -17
- package/build/utils/index_photoviewer.js +0 -14
- package/build/utils/indoor.js +0 -200
- package/build/utils/map.js +0 -788
- package/build/utils/picture.js +0 -507
- package/build/utils/semantics.js +0 -321
- package/build/utils/services.js +0 -148
- package/build/utils/utils.js +0 -433
- package/build/utils/widgets.js +0 -110
|
@@ -1,398 +0,0 @@
|
|
|
1
|
-
import Basic from "./Basic.js";
|
|
2
|
-
import Map from "../ui/Map.js";
|
|
3
|
-
import Photo from "../ui/Photo.js";
|
|
4
|
-
import { apiFeatureToPSVNode } from "../../utils/picture.js";
|
|
5
|
-
import { linkMapAndPhoto } from "../../utils/map.js";
|
|
6
|
-
import { SYSTEM as PSSystem } from "@photo-sphere-viewer/core";
|
|
7
|
-
import { createWebComp } from "../../utils/widgets.js";
|
|
8
|
-
import MapStyleComposer from "../../utils/MapStyleComposer.js";
|
|
9
|
-
import { MapTiles } from "../../utils/services.js";
|
|
10
|
-
import EditorStyles from "./Editor.css" with { type: "css" };
|
|
11
|
-
document.adoptedStyleSheets.push(EditorStyles);
|
|
12
|
-
|
|
13
|
-
const LAYER_HEADING_ID = "sequence-headings";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Editor allows to focus on a single sequence, and preview what you edits would look like.
|
|
17
|
-
* It shows both picture and map.
|
|
18
|
-
*
|
|
19
|
-
* Make sure to set width/height through CSS for proper display.
|
|
20
|
-
*
|
|
21
|
-
* This component has a [CorneredGrid](#Panoramax.components.layout.CorneredGrid) layout, you can use directly any slot element to pass custom widgets.
|
|
22
|
-
* @class Panoramax.components.core.Editor
|
|
23
|
-
* @element pnx-editor
|
|
24
|
-
* @extends Panoramax.components.core.Basic
|
|
25
|
-
* @fires Panoramax.components.core.Basic#select
|
|
26
|
-
* @fires Panoramax.components.core.Basic#ready
|
|
27
|
-
* @fires Panoramax.components.core.Basic#broken
|
|
28
|
-
* @property {Panoramax.components.ui.Loader} loader The loader screen
|
|
29
|
-
* @property {Panoramax.utils.API} api The API manager
|
|
30
|
-
* @property {Panoramax.components.ui.Map} map The MapLibre GL map itself
|
|
31
|
-
* @property {Panoramax.utils.MapStyleComposer} mapStyleComposer The map style helper
|
|
32
|
-
* @property {Panoramax.components.ui.Photo} psv The Photo Sphere Viewer component itself
|
|
33
|
-
* @property {Panoramax.components.layout.CorneredGrid} grid The grid layout manager
|
|
34
|
-
* @slot `top-left` The top-left corner
|
|
35
|
-
* @slot `top` The top middle corner
|
|
36
|
-
* @slot `top-right` The top-right corner
|
|
37
|
-
* @slot `bottom-left` The bottom-left corner
|
|
38
|
-
* @slot `bottom` The bottom middle corner
|
|
39
|
-
* @slot `bottom-right` The bottom-right corner
|
|
40
|
-
* @example
|
|
41
|
-
* ```html
|
|
42
|
-
* <!-- Basic example -->
|
|
43
|
-
* <pnx-editor
|
|
44
|
-
* endpoint="https://panoramax.openstreetmap.fr/"
|
|
45
|
-
* style="width: 300px; height: 250px"
|
|
46
|
-
* />
|
|
47
|
-
*
|
|
48
|
-
* <!-- With slotted widgets -->
|
|
49
|
-
* <pnx-editor
|
|
50
|
-
* endpoint="https://panoramax.openstreetmap.fr/"
|
|
51
|
-
* style="width: 300px; height: 250px"
|
|
52
|
-
* >
|
|
53
|
-
* <p slot="top-right">My custom text</p>
|
|
54
|
-
* </pnx-editor>
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export default class Editor extends Basic {
|
|
58
|
-
/**
|
|
59
|
-
* Component properties. All of [Basic properties](#Panoramax.components.core.Basic+properties) are available as well.
|
|
60
|
-
* @memberof Panoramax.components.core.Editor#
|
|
61
|
-
* @mixes Panoramax.components.core.Basic#properties
|
|
62
|
-
* @type {Object}
|
|
63
|
-
* @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))
|
|
64
|
-
* @property {string} [picture] The picture ID to display
|
|
65
|
-
* @property {string} [sequence] The sequence ID of the picture displayed
|
|
66
|
-
* @property {object} [fetch-options] 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))
|
|
67
|
-
* @property {string|object} [map-style] 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.
|
|
68
|
-
* @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.
|
|
69
|
-
* @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).
|
|
70
|
-
* @property {string} [background=streets] Choose default map background to display (streets or aerial, if raster aerial background available). Defaults to street.
|
|
71
|
-
*/
|
|
72
|
-
static properties = {
|
|
73
|
-
raster: {converter: Basic.GetJSONConverter()},
|
|
74
|
-
background: {type: String},
|
|
75
|
-
"map-style": {type: String},
|
|
76
|
-
...Basic.properties
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
constructor() {
|
|
80
|
-
super();
|
|
81
|
-
|
|
82
|
-
this.raster = null;
|
|
83
|
-
this.background = "streets";
|
|
84
|
-
this["map-style"] = this.getAttribute("map-style") || MapTiles();
|
|
85
|
-
|
|
86
|
-
// Check if mapstyle is not a unparsed JSON
|
|
87
|
-
try {
|
|
88
|
-
this["map-style"] = JSON.parse(this["map-style"]);
|
|
89
|
-
} catch(e) { /* Empty */ }
|
|
90
|
-
|
|
91
|
-
// Setup map styles and sources
|
|
92
|
-
this.mapStyleComposer = new MapStyleComposer(this);
|
|
93
|
-
this.mapStyleComposer.addBasemap("streets", this["map-style"], true);
|
|
94
|
-
|
|
95
|
-
// Create sub-containers
|
|
96
|
-
this._psvContainer = document.createElement("div");
|
|
97
|
-
this._psvContainer.setAttribute("slot", "bg");
|
|
98
|
-
this._mapContainer = document.createElement("div");
|
|
99
|
-
this._mapContainer.setAttribute("slot", "bg");
|
|
100
|
-
|
|
101
|
-
this.grid = createWebComp("pnx-cornered-grid");
|
|
102
|
-
this.grid.appendChild(this._psvContainer);
|
|
103
|
-
this.grid.appendChild(this._mapContainer);
|
|
104
|
-
|
|
105
|
-
this.onceAPIReady().then(() => {
|
|
106
|
-
this.loader.setAttribute("value", 30);
|
|
107
|
-
|
|
108
|
-
// Check sequence ID is set
|
|
109
|
-
if(!this.sequence) { this.loader.dismiss({}, "No sequence is selected"); }
|
|
110
|
-
|
|
111
|
-
// Events
|
|
112
|
-
this.addEventListener("select", this._onSelect.bind(this));
|
|
113
|
-
|
|
114
|
-
this._initPSV();
|
|
115
|
-
this._initMap();
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/** @private */
|
|
120
|
-
disconnectedCallback() {
|
|
121
|
-
super.disconnectedCallback();
|
|
122
|
-
this.map?.destroy();
|
|
123
|
-
this.psv?.destroy();
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// eslint-disable-next-line class-methods-use-this
|
|
127
|
-
getClassName() {
|
|
128
|
-
return "Editor";
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
onceReady() {
|
|
132
|
-
if(this.map && this.psv && this.map.loaded?.()) {
|
|
133
|
-
return Promise.resolve();
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
return new Promise(resolve => setTimeout(resolve, 100)).then(this.onceReady.bind(this));
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
connectedCallback() {
|
|
141
|
-
super.connectedCallback();
|
|
142
|
-
|
|
143
|
-
this._moveChildToGrid();
|
|
144
|
-
window.addEventListener("DOMContentLoaded", () => {
|
|
145
|
-
this._moveChildToGrid();
|
|
146
|
-
}, { once: true });
|
|
147
|
-
|
|
148
|
-
if(this.raster) {
|
|
149
|
-
const rasterLayerId = this.mapStyleComposer._createRasterBasemap(this.raster);
|
|
150
|
-
if(this.background === "aerial") { this.mapStyleComposer.switchBasemap(rasterLayerId); }
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/** @private */
|
|
155
|
-
render() {
|
|
156
|
-
return [this.loader, this.grid];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
getSubComponentsNames() {
|
|
160
|
-
return super.getSubComponentsNames().concat(["map", "psv", "grid", "mapStyleComposer"]);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/** @private */
|
|
164
|
-
_initPSV() {
|
|
165
|
-
try {
|
|
166
|
-
this.psv = new Photo(this, this._psvContainer);
|
|
167
|
-
this.psv._myVTour.datasource.nodeResolver = this._getNode.bind(this);
|
|
168
|
-
this.grid.appendChild(createWebComp("pnx-widget-player", {
|
|
169
|
-
slot: "top",
|
|
170
|
-
_parent: this,
|
|
171
|
-
class: "pnx-only-psv pnx-print-hidden",
|
|
172
|
-
size: "xl",
|
|
173
|
-
more: "never"
|
|
174
|
-
}));
|
|
175
|
-
}
|
|
176
|
-
catch(e) {
|
|
177
|
-
let err = !PSSystem.isWebGLSupported ? this._t.pnx.error_webgl : this._t.pnx.error_psv;
|
|
178
|
-
this.loader.dismiss(e, err);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/** @private */
|
|
183
|
-
_initMap() {
|
|
184
|
-
try {
|
|
185
|
-
this.map = new Map(this, this._mapContainer, {
|
|
186
|
-
background: this.background,
|
|
187
|
-
zoom: 15, // Hack to avoid _initMapPosition call
|
|
188
|
-
picMarkerDraggable: true,
|
|
189
|
-
});
|
|
190
|
-
linkMapAndPhoto(this);
|
|
191
|
-
this.loader.setAttribute("value", 50);
|
|
192
|
-
this._loadSequence();
|
|
193
|
-
this.map.once("load", () => {
|
|
194
|
-
if(this.mapStyleComposer.hasManyBasemaps()) { this._addMapBackgroundWidget(); }
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
// Override picMarker setRotation for heading preview
|
|
198
|
-
const oldRot = this.map._picMarker.setRotation.bind(this.map._picMarker);
|
|
199
|
-
this.map._picMarker.setRotation = h => {
|
|
200
|
-
h = this._lastRelHeading === undefined ? h : h + this._lastRelHeading - this.psv.getPictureRelativeHeading();
|
|
201
|
-
return oldRot(h);
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
catch(e) {
|
|
205
|
-
this.loader.dismiss(e, this._t.pnx.error_psv);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Displays currently selected sequence on map
|
|
211
|
-
* @private
|
|
212
|
-
*/
|
|
213
|
-
_loadSequence() {
|
|
214
|
-
this.loader.setAttribute("value", 60);
|
|
215
|
-
return this.api.getSequenceItems(this.sequence).then(seq => {
|
|
216
|
-
this.loader.setAttribute("value", 80);
|
|
217
|
-
|
|
218
|
-
// Create data source
|
|
219
|
-
this._sequenceData = seq.features;
|
|
220
|
-
const features = {
|
|
221
|
-
"type": "FeatureCollection",
|
|
222
|
-
"features": [
|
|
223
|
-
{
|
|
224
|
-
"id": this.sequence,
|
|
225
|
-
"type": "Feature",
|
|
226
|
-
"properties": {
|
|
227
|
-
"id": this.sequence,
|
|
228
|
-
},
|
|
229
|
-
"geometry": {
|
|
230
|
-
"type": "LineString",
|
|
231
|
-
"coordinates": seq.features.map(p => p.geometry.coordinates)
|
|
232
|
-
}
|
|
233
|
-
},
|
|
234
|
-
...seq.features.map(f => {
|
|
235
|
-
f.properties.id = f.id;
|
|
236
|
-
f.properties.sequences = [this.sequence];
|
|
237
|
-
return f;
|
|
238
|
-
})
|
|
239
|
-
]
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
// Add endpoint in style composer
|
|
243
|
-
this.map.once("styledata", () => this.loader.dismiss());
|
|
244
|
-
this.mapStyleComposer.addPanoramaxEndpoint("default", {
|
|
245
|
-
sources: {
|
|
246
|
-
geovisio: {
|
|
247
|
-
type: "geojson",
|
|
248
|
-
data: features,
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}, true);
|
|
252
|
-
|
|
253
|
-
// Select picture if any
|
|
254
|
-
if(this.picture) {
|
|
255
|
-
const pic = seq.features.find(p => p.id === this.picture);
|
|
256
|
-
if(pic) {
|
|
257
|
-
this.select(this.sequence, this.picture, true);
|
|
258
|
-
this.map.jumpTo({ center: pic.geometry.coordinates, zoom: 18 });
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
console.log("Picture with ID", pic, "was not found");
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
// Show area of sequence otherwise
|
|
265
|
-
else {
|
|
266
|
-
const bbox = [
|
|
267
|
-
...seq.features[0].geometry.coordinates,
|
|
268
|
-
...seq.features[0].geometry.coordinates
|
|
269
|
-
];
|
|
270
|
-
|
|
271
|
-
for(let i=1; i < seq.features.length; i++) {
|
|
272
|
-
const c = seq.features[i].geometry.coordinates;
|
|
273
|
-
if(c[0] < bbox[0]) { bbox[0] = c[0]; }
|
|
274
|
-
if(c[1] < bbox[1]) { bbox[1] = c[1]; }
|
|
275
|
-
if(c[0] > bbox[2]) { bbox[2] = c[0]; }
|
|
276
|
-
if(c[1] > bbox[3]) { bbox[3] = c[1]; }
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
this.map.fitBounds(bbox, {animate: false});
|
|
280
|
-
}
|
|
281
|
-
}).catch(e => this.loader.dismiss(e, this._t.pnx.error_api));
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Get the PSV node for wanted picture.
|
|
286
|
-
*
|
|
287
|
-
* @param {string} picId The picture ID
|
|
288
|
-
* @returns The PSV node
|
|
289
|
-
* @private
|
|
290
|
-
*/
|
|
291
|
-
_getNode(picId) {
|
|
292
|
-
const f = this._sequenceData.find(f => f.properties.id === picId);
|
|
293
|
-
const n = f ? apiFeatureToPSVNode(f, this._t, this._isInternetFast, undefined, u => this.api.cleanResourceURL(u)) : null;
|
|
294
|
-
return n;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Creates the widget to switch between aerial and streets imagery
|
|
299
|
-
* @private
|
|
300
|
-
*/
|
|
301
|
-
_addMapBackgroundWidget() {
|
|
302
|
-
// Container
|
|
303
|
-
const pnlLayers = createWebComp("pnx-map-background", {_parent: this, size: "sm", slot: "bottom-left"});
|
|
304
|
-
this.grid.appendChild(pnlLayers);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
/** @private */
|
|
308
|
-
_moveChildToGrid() {
|
|
309
|
-
const slotContent = Array.from(this.querySelectorAll("[slot]"));
|
|
310
|
-
|
|
311
|
-
slotContent.forEach(n => {
|
|
312
|
-
// Add parent + translation for our components
|
|
313
|
-
if(n.tagName?.toLowerCase().startsWith("pnx-")) {
|
|
314
|
-
n._parent = this;
|
|
315
|
-
n._t = this._t;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
this.grid.appendChild(n);
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Preview on map how the new relative heading would reflect on all pictures.
|
|
324
|
-
* This doesn't change anything on API-side, it's just a preview.
|
|
325
|
-
* @memberof Panoramax.components.core.Editor#
|
|
326
|
-
* @param {number} [relHeading] The new relative heading compared to sequence path. In degrees, between -180 and 180 (0 = front, -90 = left, 90 = right). Set to null to remove preview.
|
|
327
|
-
*/
|
|
328
|
-
previewSequenceHeadingChange(relHeading) {
|
|
329
|
-
const layerExists = this.mapStyleComposer.layerRanges.dataOverlays[LAYER_HEADING_ID] !== undefined;
|
|
330
|
-
this.map._picMarkerPreview.remove();
|
|
331
|
-
|
|
332
|
-
// If no value set, remove layer
|
|
333
|
-
if(relHeading === undefined) {
|
|
334
|
-
delete this._lastRelHeading;
|
|
335
|
-
if(layerExists) {
|
|
336
|
-
this.mapStyleComposer.switchDataOverlayVisibility(LAYER_HEADING_ID, false);
|
|
337
|
-
}
|
|
338
|
-
// Update selected picture marker
|
|
339
|
-
if(this.picture) {
|
|
340
|
-
this.map._picMarker.setRotation(this.psv.getXY().x);
|
|
341
|
-
}
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
this._lastRelHeading = relHeading;
|
|
346
|
-
|
|
347
|
-
// Create preview layer
|
|
348
|
-
if(!layerExists) {
|
|
349
|
-
this.mapStyleComposer.addDataOverlay(LAYER_HEADING_ID, { layers: [{
|
|
350
|
-
"id": LAYER_HEADING_ID,
|
|
351
|
-
"type": "symbol",
|
|
352
|
-
"source": "geovisio",
|
|
353
|
-
"layout": {
|
|
354
|
-
"icon-image": "pnx-marker",
|
|
355
|
-
"icon-overlap": "always",
|
|
356
|
-
"icon-size": 0.8,
|
|
357
|
-
},
|
|
358
|
-
}] }, true);
|
|
359
|
-
} else {
|
|
360
|
-
this.mapStyleComposer.switchDataOverlayVisibility(LAYER_HEADING_ID, true);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// Update selected picture marker
|
|
364
|
-
if(this.picture) {
|
|
365
|
-
this.map._picMarker.setRotation(this.psv.getXY().x);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
this.mapStyleComposer.waitFor("dataOverlays", LAYER_HEADING_ID).then(() => {
|
|
369
|
-
// Change heading
|
|
370
|
-
const layer = this.mapStyleComposer.layerRanges.dataOverlays[LAYER_HEADING_ID];
|
|
371
|
-
const currentRelHeading = - this.psv.getPictureRelativeHeading();
|
|
372
|
-
layer.layers[0].layout["icon-rotate"] = ["+", ["get", "view:azimuth"], currentRelHeading, relHeading ];
|
|
373
|
-
|
|
374
|
-
// Skip selected picture and linestring geom
|
|
375
|
-
const filters = [["==", ["geometry-type"], "Point"]];
|
|
376
|
-
if(this.picture) { filters.push(["!=", ["get", "id"], this.picture]); }
|
|
377
|
-
layer.filter = ["all", ...filters];
|
|
378
|
-
|
|
379
|
-
this.mapStyleComposer.updateMapStyle();
|
|
380
|
-
setTimeout(() => {
|
|
381
|
-
this.map.setFilter(LAYER_HEADING_ID, ["all", ...filters]);
|
|
382
|
-
}, 100);
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Event handler for picture loading
|
|
388
|
-
* @private
|
|
389
|
-
*/
|
|
390
|
-
_onSelect() {
|
|
391
|
-
// Update preview of heading change
|
|
392
|
-
if(this._lastRelHeading !== undefined) {
|
|
393
|
-
this.previewSequenceHeadingChange(this._lastRelHeading);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
customElements.define("pnx-editor", Editor);
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
pnx-photo-viewer {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: block;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
/* Maximized components */
|
|
7
|
-
pnx-photo-viewer .pnx-psv {
|
|
8
|
-
position: absolute;
|
|
9
|
-
inset: 0;
|
|
10
|
-
z-index: 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/* No PSV loader */
|
|
14
|
-
pnx-photo-viewer .psv-loader {
|
|
15
|
-
display: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/* Cornered grid layout */
|
|
19
|
-
pnx-photo-viewer pnx-cornered-grid::part(corner-top-left),
|
|
20
|
-
pnx-photo-viewer pnx-cornered-grid::part(corner-top),
|
|
21
|
-
pnx-photo-viewer pnx-cornered-grid::part(corner-top-right),
|
|
22
|
-
pnx-photo-viewer pnx-cornered-grid::part(corner-bottom-left),
|
|
23
|
-
pnx-photo-viewer pnx-cornered-grid::part(corner-bottom),
|
|
24
|
-
pnx-photo-viewer pnx-cornered-grid::part(corner-bottom-right) {
|
|
25
|
-
gap: 10px;
|
|
26
|
-
padding: 10px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@media screen and (max-width: 576px) {
|
|
30
|
-
pnx-photo-viewer pnx-cornered-grid::part(corner-top-right) {
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
align-items: flex-end;
|
|
33
|
-
justify-content: flex-start;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
pnx-photo-viewer pnx-cornered-grid::part(corner-top-left) {
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
align-items: flex-start;
|
|
39
|
-
justify-content: flex-start;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/* Hidden widgets on sequence play */
|
|
44
|
-
pnx-photo-viewer.pnx-playing pnx-bottom-drawer,
|
|
45
|
-
pnx-photo-viewer.pnx-playing pnx-widget-legend,
|
|
46
|
-
pnx-photo-viewer.pnx-playing pnx-widget-zoom {
|
|
47
|
-
display: none;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* Override legend positioning */
|
|
51
|
-
@media screen and (min-width: 576px) {
|
|
52
|
-
pnx-photo-viewer pnx-widget-legend:not([light="true"]) {
|
|
53
|
-
position: absolute;
|
|
54
|
-
top: 10px;
|
|
55
|
-
width: 100%;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* Hidden widgets on grid toggled */
|
|
60
|
-
pnx-photo-viewer .psv-virtual-tour-arrows {
|
|
61
|
-
transition: opacity 0.25s ease-in-out;
|
|
62
|
-
opacity: 100%;
|
|
63
|
-
}
|
|
64
|
-
pnx-photo-viewer.pnx-grid-toggled .psv-virtual-tour-arrows {
|
|
65
|
-
opacity: 0%;
|
|
66
|
-
}
|
|
67
|
-
pnx-photo-viewer.pnx-grid-toggled .psv-virtual-tour-arrows button {
|
|
68
|
-
pointer-events: none;
|
|
69
|
-
cursor: unset;
|
|
70
|
-
}
|