@panoramax/web-viewer 3.2.3-develop-e277ccb9 → 3.2.3-develop-dbce84df
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/PhotoViewer.md +256 -0
- package/docs/reference/components/core/Viewer.md +47 -49
- 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/PhotoViewer.css +65 -0
- package/src/components/core/PhotoViewer.js +441 -0
- package/src/components/core/Viewer.js +71 -306
- package/src/components/core/index.js +1 -0
- package/src/components/menus/MapLegend.js +1 -21
- 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/translations/nl.json +105 -5
- package/src/utils/API.js +2 -2
- package/src/utils/InitParameters.js +29 -16
- 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
package/src/translations/nl.json
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"moveDown": "Naar beneden",
|
|
7
7
|
"search_user": "Zoek een gebruikersnaam…",
|
|
8
8
|
"moveUp": "Ga omhoog",
|
|
9
|
-
"share_rss": "RSS
|
|
9
|
+
"share_rss": "RSS-feed",
|
|
10
10
|
"loading_labels_serious": [
|
|
11
11
|
"🗺️ Kaart aan het laden",
|
|
12
12
|
"🖥️ API opvragen",
|
|
13
13
|
"🖼️ Miniatuurweergaven laden",
|
|
14
14
|
"🔍 EXIF metadata analyseren",
|
|
15
|
-
"🏘️ 3D
|
|
15
|
+
"🏘️ 3D-rendering",
|
|
16
16
|
"📷 360° afbeelden initialiseren",
|
|
17
17
|
"🟠 Kleur balancering",
|
|
18
18
|
"💯 Bereken kwaliteits-score ©"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"share_page": "Link naar deze pagina",
|
|
43
43
|
"share_image": "HD afbeelding",
|
|
44
44
|
"share_embed": "Embedden op uw website",
|
|
45
|
-
"share_print": "
|
|
45
|
+
"share_print": "Afdrukken",
|
|
46
46
|
"copy": "Kopieer",
|
|
47
47
|
"copied": "Gekopieerd",
|
|
48
48
|
"error": "We hebben een probleem…",
|
|
@@ -69,10 +69,102 @@
|
|
|
69
69
|
"🚲 Fiets- en wandelpaden bijwerken",
|
|
70
70
|
"🚉 Perron doorgang",
|
|
71
71
|
"🛰️ Satellieten zoeken",
|
|
72
|
-
"👥 Personas opslaan"
|
|
72
|
+
"👥 Personas opslaan",
|
|
73
|
+
"🥞 Pannenkoekenhuizen localiseren",
|
|
74
|
+
"🧑💻 Interface debuggen",
|
|
75
|
+
"📈 Statistieken verhogen"
|
|
73
76
|
],
|
|
74
77
|
"share_rss_title": "RSS-feed van nieuwe reeksen in het nu zichtbare kaartgebied",
|
|
75
|
-
"josm_live": "Schakel JOSM automatische synchronisatie in bij het laden van afbeeldingen"
|
|
78
|
+
"josm_live": "Schakel JOSM automatische synchronisatie in bij het laden van afbeeldingen",
|
|
79
|
+
"minimize_short": "Verbergen",
|
|
80
|
+
"error_psv": "Photo Sphere Viewer werd niet correct geladen",
|
|
81
|
+
"error_nopic": "Geen foto beschikbaar op de aangegeven locatie",
|
|
82
|
+
"error_api": "De fotoserver is niet beschikbaar",
|
|
83
|
+
"error_webgl": "WebGL wordt niet ondersteund door je browser",
|
|
84
|
+
"error_api_compatibility": "De fotoserver is niet compatibel met deze viewer",
|
|
85
|
+
"filter_date_1month": "1 maand",
|
|
86
|
+
"filter_date_1year": "1 jaar",
|
|
87
|
+
"filter_user": "Gebruiker",
|
|
88
|
+
"filter_user_mypics": "Mijn foto's",
|
|
89
|
+
"filter_picture": "Afbeeldingstype",
|
|
90
|
+
"picture_flat": "Klassiek",
|
|
91
|
+
"picture_360": "360°",
|
|
92
|
+
"filter_qualityscore": "Kwaliteitsscore",
|
|
93
|
+
"qualityscore_doc_2": "De score wordt getoond als een letter A/B/C/D/E (waarbij A het beste is en E het slechtse), en wordt grafisch weergegeven volgens deze schaal:",
|
|
94
|
+
"qualityscore_doc_link": "Meer weten over de Kwaliteitsscore",
|
|
95
|
+
"map_background": "Kaartachtergrond",
|
|
96
|
+
"map_background_aerial": "Satelliet",
|
|
97
|
+
"map_background_streets": "Straten",
|
|
98
|
+
"map_theme": "Kaartthema",
|
|
99
|
+
"map_theme_default": "Klassiek",
|
|
100
|
+
"map_theme_age": "Opnamedatum",
|
|
101
|
+
"map_theme_age_3": "< 1 jaar",
|
|
102
|
+
"map_theme_age_4": "< 1 maand",
|
|
103
|
+
"filter_qualityscore_help": "Klik om aan- of uit te schakelen",
|
|
104
|
+
"report_failure": "Er is een fout opgetreden bij het aanmaken van het rapport: {e}. Probleem later opnieuw.",
|
|
105
|
+
"map_theme_score": "Kwaliteitsscore",
|
|
106
|
+
"contrast": "Afbeeldingscontrast verhogen",
|
|
107
|
+
"metadata": "Metadata van de foto",
|
|
108
|
+
"metadata_camera_make": "Fabrikant",
|
|
109
|
+
"filter_date": "Datum",
|
|
110
|
+
"filter_zoom_in": "Zoom in om deze filter te zien",
|
|
111
|
+
"metadata_general_license_link": "De volledige beschrijving van de licentie bekijken",
|
|
112
|
+
"metadata_general_seqid": "Identificator van de sequentie",
|
|
113
|
+
"metadata_general_picid_link": "Ga naar de JSON-beschrijving van de foto",
|
|
114
|
+
"metadata_general_seqid_link": "Ga naar de JSON-beschrijving van de sequentie",
|
|
115
|
+
"metadata_general_author": "Auteur",
|
|
116
|
+
"error_josm": "JOSM antwoord niet, is het actief en is afstandsbediening ingeschakeld?",
|
|
117
|
+
"qualityscore_title": "Over de kwaliteitsscore",
|
|
118
|
+
"metadata_general_license": "Licentie",
|
|
119
|
+
"error_pic": "The gevraagde foto werd niet gevonden",
|
|
120
|
+
"map_theme_age_2": "< 2 jaar",
|
|
121
|
+
"metadata_general_picid": "Identificator van de foto",
|
|
122
|
+
"metadata_general_date": "Opnamedatum",
|
|
123
|
+
"map_theme_type": "Cameratype",
|
|
124
|
+
"qualityscore_doc_1": "Panoramax toont een Kwaliteitsscore voor elke foto. Dit vergemakkelijkt filtering en laat toe om foto's van hoge kwaliteit te vinden.",
|
|
125
|
+
"qualityscore_doc_3": "Hij wordt berekend op basis van de GPS-nauwkeurigheid en resolutie van de foto. Een professioneel systeem zal een A-score hebben, een 360° actiecamera een B-score, en een smartphone een C/D/E-score.",
|
|
126
|
+
"map_theme_age_1": "> 2 jaar",
|
|
127
|
+
"report_details_placeholder": "Je kan, optioneel, details over het probleem toevoegen",
|
|
128
|
+
"metadata_camera": "Apparaat",
|
|
129
|
+
"metadata_camera_model": "Model",
|
|
130
|
+
"metadata_camera_type": "Type",
|
|
131
|
+
"metadata_camera_resolution": "Resolutie",
|
|
132
|
+
"metadata_camera_focal_length": "Brandpuntsafstand",
|
|
133
|
+
"metadata_location": "Locatie",
|
|
134
|
+
"metadata_location_longitude": "Longitude",
|
|
135
|
+
"metadata_location_latitude": "Latitude",
|
|
136
|
+
"metadata_location_orientation": "Opnamerichting",
|
|
137
|
+
"metadata_location_precision": "Nauwkeurigheid van de positionering",
|
|
138
|
+
"metadata_quality": "Kwaliteitsscore",
|
|
139
|
+
"metadata_quality_help": "Meer weten over de Kwaliteitsscore",
|
|
140
|
+
"metadata_quality_score": "Globale score",
|
|
141
|
+
"metadata_quality_gps_score": "Positioneringsscore",
|
|
142
|
+
"metadata_quality_resolution_score": "Resolutiescore",
|
|
143
|
+
"metadata_quality_missing": "geen info in de afbeelding",
|
|
144
|
+
"metadata_exif": "EXIF / XMP",
|
|
145
|
+
"metadata_exif_name": "Tag",
|
|
146
|
+
"metadata_exif_value": "Waarde",
|
|
147
|
+
"report": "Foto rapporteren",
|
|
148
|
+
"report_auth": "Dit rapport zal worden verstuurd met je account \"{a}\"",
|
|
149
|
+
"report_nature_label": "Aard van het probleem",
|
|
150
|
+
"report_nature": {
|
|
151
|
+
"": "Selecteer de aard van het probleem …",
|
|
152
|
+
"blur_missing": "Het gezicht van een persoon of een nummerplaat is zichtbaar",
|
|
153
|
+
"blur_excess": "Een object dat niet vervaagd moet worden is vervaagd",
|
|
154
|
+
"inappropriate": "De foto is ongepast (ongerelateerd, naaktheid …)",
|
|
155
|
+
"privacy": "Een private weg of een privaat eigendom is zichtbaar",
|
|
156
|
+
"picture_low_quality": "De foto is van slechte kwaliteit",
|
|
157
|
+
"mislocated": "De foto is slecht gepositioneerd",
|
|
158
|
+
"copyright": "De foto schendt het auteursrecht",
|
|
159
|
+
"other": "Een ander soort probleem"
|
|
160
|
+
},
|
|
161
|
+
"report_whole_sequence": "Dit betreft de volledige sequentie",
|
|
162
|
+
"report_details": "Aanvullende details",
|
|
163
|
+
"report_email": "Je e-mail",
|
|
164
|
+
"report_email_placeholder": "Optioneel",
|
|
165
|
+
"report_submit": "Verzenden",
|
|
166
|
+
"report_wait": "Rapport verzenden …",
|
|
167
|
+
"report_success": "Het rapport werd succesvol verzonden. Het zal zo snel mogelijk behandeld worden."
|
|
76
168
|
},
|
|
77
169
|
"psv": {
|
|
78
170
|
"twoFingers": "Gebruik twee vingers om te navigeren",
|
|
@@ -82,5 +174,13 @@
|
|
|
82
174
|
"maplibre": {
|
|
83
175
|
"GeolocateControl.FindMyLocation": "Mijn locatie zoeken",
|
|
84
176
|
"GeolocateControl.LocationNotAvailable": "Locatitie niet beschikbaar"
|
|
177
|
+
},
|
|
178
|
+
"map": {
|
|
179
|
+
"loading": "Laden …",
|
|
180
|
+
"slow_loading": "De kaart laadt traag en kan er gebroken uitzien",
|
|
181
|
+
"thumbnail": "Thumbnail van de aangeduide foto",
|
|
182
|
+
"not_public": "Niet openbaar zichtbaar",
|
|
183
|
+
"map_data": "Kaartdata:",
|
|
184
|
+
"more_panoramax": "Meer weten over Panoramax"
|
|
85
185
|
}
|
|
86
186
|
}
|
package/src/utils/API.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TILES_PICTURES_ZOOM } from "./map";
|
|
2
|
-
import {
|
|
2
|
+
import { isNullId } from "./utils";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* API contains various utility functions to communicate with Panoramax/STAC API
|
|
@@ -772,7 +772,7 @@ export default class API {
|
|
|
772
772
|
* @throws {Error} If not valid
|
|
773
773
|
*/
|
|
774
774
|
static isIdValid(id) {
|
|
775
|
-
if(
|
|
775
|
+
if(isNullId(id)) {
|
|
776
776
|
throw new Error("id should be a valid picture unique identifier");
|
|
777
777
|
}
|
|
778
778
|
return true;
|
|
@@ -306,13 +306,15 @@ export function alterPSVState(psv, params) {
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
// Change transitionDuration
|
|
309
|
-
|
|
310
|
-
|
|
309
|
+
let td = params.transitionDuration || params.speed;
|
|
310
|
+
if(td !== undefined) {
|
|
311
|
+
psv.setTransitionDuration(td);
|
|
311
312
|
}
|
|
312
313
|
|
|
313
314
|
// Change pictures navigation mode
|
|
314
|
-
|
|
315
|
-
|
|
315
|
+
let nav = params.picturesNavigation || params.nav;
|
|
316
|
+
if(["none", "pic", "any", "seq"].includes(nav)) {
|
|
317
|
+
psv.setPicturesNavigation(nav);
|
|
316
318
|
}
|
|
317
319
|
}
|
|
318
320
|
|
|
@@ -343,39 +345,50 @@ export function alterMapState(map, params) {
|
|
|
343
345
|
}
|
|
344
346
|
|
|
345
347
|
/**
|
|
346
|
-
* Change
|
|
347
|
-
* @param {
|
|
348
|
+
* Change PhotoViewer current state based on standardized parameters.
|
|
349
|
+
* @param {PhotoViewer} viewer The PhotoViewer component to change.
|
|
348
350
|
* @param {object} params The parameters to apply.
|
|
349
351
|
*/
|
|
350
|
-
export function
|
|
352
|
+
export function alterPhotoViewerState(viewer, params) {
|
|
351
353
|
// Restore selected picture
|
|
352
|
-
|
|
353
|
-
|
|
354
|
+
let pic = params.picture || params.pic;
|
|
355
|
+
if(pic) {
|
|
356
|
+
const picIds = pic.split(";"); // Handle multiple IDs coming from OSM
|
|
354
357
|
if(picIds.length > 1) {
|
|
355
358
|
console.warn("Multiple picture IDs passed in URL, only first one kept");
|
|
356
359
|
}
|
|
357
360
|
|
|
358
|
-
// Post-load changes
|
|
359
|
-
if(params.focus && params.focus == "meta") {
|
|
360
|
-
viewer.psv.addEventListener("picture-loaded", () => viewer._showPictureMetadata(), { once: true });
|
|
361
|
-
}
|
|
362
|
-
|
|
363
361
|
viewer.select(null, picIds[0]);
|
|
364
362
|
}
|
|
365
363
|
else {
|
|
366
364
|
viewer.select();
|
|
367
365
|
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Change Viewer current state based on standardized parameters.
|
|
370
|
+
* @param {Viewer} viewer The Viewer component to change.
|
|
371
|
+
* @param {object} params The parameters to apply.
|
|
372
|
+
*/
|
|
373
|
+
export function alterViewerState(viewer, params) {
|
|
374
|
+
alterPhotoViewerState(viewer, params);
|
|
375
|
+
|
|
376
|
+
// Restore selected picture
|
|
377
|
+
let pic = params.picture || params.pic;
|
|
378
|
+
if(pic && params.focus && params.focus == "meta") {
|
|
379
|
+
viewer.psv.addEventListener("picture-loaded", () => viewer._showPictureMetadata(), { once: true });
|
|
380
|
+
}
|
|
368
381
|
|
|
369
382
|
// Change focus
|
|
370
383
|
if(params.focus === "map" && viewer?.map) {
|
|
371
384
|
viewer.setPopup(false);
|
|
372
385
|
viewer._setFocus("map", null, params.forceFocus);
|
|
373
386
|
}
|
|
374
|
-
else if(params.focus === "pic") {
|
|
387
|
+
else if(params.focus === "pic" && viewer?.mini) {
|
|
375
388
|
viewer.setPopup(false);
|
|
376
389
|
viewer._setFocus("pic", null, params.forceFocus);
|
|
377
390
|
}
|
|
378
|
-
else if(params.focus && params.focus === "meta") {
|
|
391
|
+
else if(params.focus && params.focus === "meta" && viewer?.mini) {
|
|
379
392
|
viewer._setFocus("pic", null, params.forceFocus);
|
|
380
393
|
}
|
|
381
394
|
}
|
package/src/utils/URLHandler.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
alterPSVState, MAP_FILTERS_JS2URL, alterMapState, alterViewerState
|
|
2
|
+
alterPSVState, MAP_FILTERS_JS2URL, alterMapState, alterViewerState, alterPhotoViewerState
|
|
3
3
|
} from "./InitParameters";
|
|
4
|
+
import Viewer from "../components/core/Viewer";
|
|
4
5
|
|
|
5
6
|
// List of supported parameters
|
|
6
7
|
const MANAGED_PARAMETERS = [
|
|
@@ -61,9 +62,11 @@ export default class URLHandler extends EventTarget {
|
|
|
61
62
|
hashParts.nav = this._parent.psv.getPicturesNavigation();
|
|
62
63
|
}
|
|
63
64
|
|
|
65
|
+
if(this._parent.psv.getPictureId()) {
|
|
66
|
+
hashParts.pic = this._parent.psv.getPictureId();
|
|
67
|
+
}
|
|
64
68
|
const picMeta = this._parent.psv.getPictureMetadata();
|
|
65
69
|
if (picMeta) {
|
|
66
|
-
hashParts.pic = picMeta.id;
|
|
67
70
|
hashParts.xyz = this.currentPSVString();
|
|
68
71
|
}
|
|
69
72
|
|
|
@@ -93,7 +96,7 @@ export default class URLHandler extends EventTarget {
|
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
|
-
else {
|
|
99
|
+
else if(this._parent instanceof Viewer) {
|
|
97
100
|
hashParts.map = "none";
|
|
98
101
|
}
|
|
99
102
|
return hashParts;
|
|
@@ -256,7 +259,10 @@ export default class URLHandler extends EventTarget {
|
|
|
256
259
|
*/
|
|
257
260
|
_onURLChange() {
|
|
258
261
|
let vals = this.currentURLParams();
|
|
259
|
-
|
|
262
|
+
|
|
263
|
+
if(this._parent instanceof Viewer) { alterViewerState(this._parent, vals); }
|
|
264
|
+
else { alterPhotoViewerState(this._parent, vals); }
|
|
265
|
+
|
|
260
266
|
alterPSVState(this._parent.psv, vals);
|
|
261
267
|
if(this._parent.map) { alterMapState(this._parent.map, vals); }
|
|
262
268
|
}
|
|
@@ -329,7 +335,7 @@ export default class URLHandler extends EventTarget {
|
|
|
329
335
|
if(prevUrl.search == nextUrl.search) { return; }
|
|
330
336
|
|
|
331
337
|
const prevPic = this.currentURLParams().pic || "";
|
|
332
|
-
const nextPic = this._parent?.psv?.
|
|
338
|
+
const nextPic = this._parent?.psv?.getPictureId?.() || "";
|
|
333
339
|
|
|
334
340
|
const prevFocus = this.currentURLParams().focus || "";
|
|
335
341
|
const nextFocus = nextUrl.search.includes("focus=meta") ? "meta" : (nextUrl.search.includes("focus=map") ? "map" : "pic");
|
package/src/utils/map.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import LoaderImg from "../img/marker.svg";
|
|
2
2
|
import { COLORS, QUALITYSCORE_RES_FLAT_VALUES, QUALITYSCORE_RES_360_VALUES, QUALITYSCORE_GPS_VALUES, QUALITYSCORE_POND_RES, QUALITYSCORE_POND_GPS } from "./utils";
|
|
3
3
|
import { autoDetectLocale } from "./i18n";
|
|
4
|
-
import {
|
|
4
|
+
import { isNullId } from "./utils";
|
|
5
5
|
|
|
6
6
|
export const DEFAULT_TILES = "https://panoramax.openstreetmap.fr/pmtiles/basic.json";
|
|
7
7
|
export const RASTER_LAYER_ID = "pnx-aerial";
|
|
@@ -398,7 +398,7 @@ export function switchCoefValue(expr, newCoefVal) {
|
|
|
398
398
|
export function linkMapAndPhoto(parent) {
|
|
399
399
|
// Switched picture
|
|
400
400
|
const onPicLoad = e => {
|
|
401
|
-
if(
|
|
401
|
+
if(isNullId(e.detail.picId)) {
|
|
402
402
|
parent.map.displayPictureMarker();
|
|
403
403
|
if(parent?.isMapWide?.()) {
|
|
404
404
|
parent?.mini?.setAttribute("collapsed", "");
|
|
@@ -66,8 +66,8 @@ describe("getPictureMetadata", () => {
|
|
|
66
66
|
const p = createParent();
|
|
67
67
|
const c = document.createElement("div");
|
|
68
68
|
const ph = new Photo(p, c);
|
|
69
|
-
ph._myVTour.state.currentNode = { bla: "bla" };
|
|
70
|
-
expect(ph.getPictureMetadata()).toStrictEqual({ bla: "bla" });
|
|
69
|
+
ph._myVTour.state.currentNode = { id: "1234", bla: "bla" };
|
|
70
|
+
expect(ph.getPictureMetadata()).toStrictEqual({ id: "1234", bla: "bla" });
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
it("nulls when no pic is selected", () => {
|
|
@@ -111,7 +111,7 @@ describe("goToNextPicture", () => {
|
|
|
111
111
|
const p = createParent();
|
|
112
112
|
const c = document.createElement("div");
|
|
113
113
|
const ph = new Photo(p, c);
|
|
114
|
-
ph._myVTour = { state: { currentNode: { sequence: { id: "seq", nextPic: "idnext" } } } };
|
|
114
|
+
ph._myVTour = { state: { currentNode: { id: "bla", sequence: { id: "seq", nextPic: "idnext" } } } };
|
|
115
115
|
ph.goToNextPicture();
|
|
116
116
|
expect(p.select.mock.calls).toEqual([["seq", "idnext"]]);
|
|
117
117
|
});
|
|
@@ -120,7 +120,7 @@ describe("goToNextPicture", () => {
|
|
|
120
120
|
const p = createParent();
|
|
121
121
|
const c = document.createElement("div");
|
|
122
122
|
const ph = new Photo(p, c);
|
|
123
|
-
ph._myVTour = { state: { currentNode: { sequence: {} } } };
|
|
123
|
+
ph._myVTour = { state: { currentNode: { id: "bla", sequence: {} } } };
|
|
124
124
|
expect(() => ph.goToNextPicture()).toThrow(new Error("No next picture available"));
|
|
125
125
|
});
|
|
126
126
|
});
|
|
@@ -138,7 +138,7 @@ describe("goToPrevPicture", () => {
|
|
|
138
138
|
const p = createParent();
|
|
139
139
|
const c = document.createElement("div");
|
|
140
140
|
const ph = new Photo(p, c);
|
|
141
|
-
ph._myVTour = { state: { currentNode: { sequence: { id: "seq", prevPic: "idprev" } } } };
|
|
141
|
+
ph._myVTour = { state: { currentNode: { id: "bla", sequence: { id: "seq", prevPic: "idprev" } } } };
|
|
142
142
|
ph.goToPrevPicture();
|
|
143
143
|
expect(p.select.mock.calls).toEqual([["seq", "idprev"]]);
|
|
144
144
|
});
|
|
@@ -147,7 +147,7 @@ describe("goToPrevPicture", () => {
|
|
|
147
147
|
const p = createParent();
|
|
148
148
|
const c = document.createElement("div");
|
|
149
149
|
const ph = new Photo(p, c);
|
|
150
|
-
ph._myVTour = { state: { currentNode: { sequence: {} } } };
|
|
150
|
+
ph._myVTour = { state: { currentNode: { id: "bla", sequence: {} } } };
|
|
151
151
|
expect(() => ph.goToPrevPicture()).toThrow(new Error("No previous picture available"));
|
|
152
152
|
});
|
|
153
153
|
});
|
|
@@ -31,10 +31,11 @@ describe("nextURLString", () => {
|
|
|
31
31
|
getPicturesNavigation: () => null,
|
|
32
32
|
getTransitionDuration: () => null,
|
|
33
33
|
getPictureMetadata: () => null,
|
|
34
|
+
getPictureId: () => null,
|
|
34
35
|
},
|
|
35
36
|
};
|
|
36
37
|
const uh = new URLHandler(v);
|
|
37
|
-
expect(uh.nextURLString()).toBe("?
|
|
38
|
+
expect(uh.nextURLString()).toBe("?");
|
|
38
39
|
});
|
|
39
40
|
|
|
40
41
|
it("works with picture metadata", () => {
|
|
@@ -43,12 +44,13 @@ describe("nextURLString", () => {
|
|
|
43
44
|
psv: {
|
|
44
45
|
getPicturesNavigation: () => null,
|
|
45
46
|
getTransitionDuration: () => null,
|
|
46
|
-
getPictureMetadata: () => ({
|
|
47
|
+
getPictureMetadata: () => ({}),
|
|
48
|
+
getPictureId: () => "cbfc3add-8173-4464-98c8-de2a43c6a50f",
|
|
47
49
|
},
|
|
48
50
|
};
|
|
49
51
|
const uh = new URLHandler(v);
|
|
50
52
|
uh.currentPSVString = () => "0/1/2";
|
|
51
|
-
expect(uh.nextURLString()).toBe("?
|
|
53
|
+
expect(uh.nextURLString()).toBe("?pic=cbfc3add-8173-4464-98c8-de2a43c6a50f&xyz=0/1/2");
|
|
52
54
|
});
|
|
53
55
|
|
|
54
56
|
it("works with map started + wide", () => {
|
|
@@ -58,6 +60,7 @@ describe("nextURLString", () => {
|
|
|
58
60
|
getPicturesNavigation: () => null,
|
|
59
61
|
getTransitionDuration: () => null,
|
|
60
62
|
getPictureMetadata: () => null,
|
|
63
|
+
getPictureId: () => null,
|
|
61
64
|
},
|
|
62
65
|
map: {
|
|
63
66
|
getVisibleUsers: () => ["geovisio"],
|
|
@@ -78,7 +81,8 @@ describe("nextURLString", () => {
|
|
|
78
81
|
psv: {
|
|
79
82
|
getPicturesNavigation: () => null,
|
|
80
83
|
getTransitionDuration: () => null,
|
|
81
|
-
getPictureMetadata: () => ({
|
|
84
|
+
getPictureMetadata: () => ({}),
|
|
85
|
+
getPictureId: () => "cbfc3add-8173-4464-98c8-de2a43c6a50f",
|
|
82
86
|
},
|
|
83
87
|
map: {
|
|
84
88
|
getVisibleUsers: () => ["geovisio"],
|
|
@@ -101,6 +105,7 @@ describe("nextURLString", () => {
|
|
|
101
105
|
getPicturesNavigation: () => null,
|
|
102
106
|
getTransitionDuration: () => null,
|
|
103
107
|
getPictureMetadata: () => null,
|
|
108
|
+
getPictureId: () => null,
|
|
104
109
|
},
|
|
105
110
|
map: {
|
|
106
111
|
getVisibleUsers: () => ["geovisio"],
|
|
@@ -129,10 +134,11 @@ describe("nextURLString", () => {
|
|
|
129
134
|
getPicturesNavigation: () => null,
|
|
130
135
|
getTransitionDuration: () => 250,
|
|
131
136
|
getPictureMetadata: () => null,
|
|
137
|
+
getPictureId: () => null,
|
|
132
138
|
},
|
|
133
139
|
};
|
|
134
140
|
const uh = new URLHandler(v);
|
|
135
|
-
expect(uh.nextURLString()).toBe("?
|
|
141
|
+
expect(uh.nextURLString()).toBe("?speed=250");
|
|
136
142
|
});
|
|
137
143
|
|
|
138
144
|
it("works with popup", () => {
|
|
@@ -142,6 +148,7 @@ describe("nextURLString", () => {
|
|
|
142
148
|
getPicturesNavigation: () => null,
|
|
143
149
|
getTransitionDuration: () => null,
|
|
144
150
|
getPictureMetadata: () => null,
|
|
151
|
+
getPictureId: () => null,
|
|
145
152
|
},
|
|
146
153
|
map: {
|
|
147
154
|
getVisibleUsers: () => ["geovisio"],
|
|
@@ -163,10 +170,11 @@ describe("nextURLString", () => {
|
|
|
163
170
|
getPicturesNavigation: () => "pic",
|
|
164
171
|
getTransitionDuration: () => null,
|
|
165
172
|
getPictureMetadata: () => null,
|
|
173
|
+
getPictureId: () => null,
|
|
166
174
|
},
|
|
167
175
|
};
|
|
168
176
|
const uh = new URLHandler(v);
|
|
169
|
-
expect(uh.nextURLString()).toBe("?
|
|
177
|
+
expect(uh.nextURLString()).toBe("?nav=pic");
|
|
170
178
|
});
|
|
171
179
|
});
|
|
172
180
|
|
|
@@ -312,6 +320,7 @@ describe("currentPSVString", () => {
|
|
|
312
320
|
addEventListener: jest.fn(),
|
|
313
321
|
psv: {
|
|
314
322
|
getXYZ: () => ({ x: 12.123456, y: 50.789456, z: 75 }),
|
|
323
|
+
getPictureId: () => null,
|
|
315
324
|
},
|
|
316
325
|
};
|
|
317
326
|
const uh = new URLHandler(v);
|
|
@@ -323,6 +332,7 @@ describe("currentPSVString", () => {
|
|
|
323
332
|
addEventListener: jest.fn(),
|
|
324
333
|
psv: {
|
|
325
334
|
getXYZ: () => ({ x: 12, y: 50 }),
|
|
335
|
+
getPictureId: () => null,
|
|
326
336
|
},
|
|
327
337
|
};
|
|
328
338
|
const uh = new URLHandler(v);
|