@panoramax/web-viewer 4.0.3-develop-05bbd331 → 4.0.3-develop-e6a52885
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 +5 -0
- package/build/index.js +3 -3
- package/build/index.js.map +1 -1
- package/docs/reference/components/core/PhotoViewer.md +1 -0
- package/docs/reference/components/core/Viewer.md +1 -0
- package/docs/reference/components/ui/Map.md +12 -0
- package/docs/reference/components/ui/MapMore.md +1 -0
- package/package.json +1 -1
- package/src/components/core/PhotoViewer.js +7 -1
- package/src/components/core/Viewer.js +5 -1
- package/src/components/ui/Map.js +3 -0
- package/src/components/ui/MapMore.js +61 -25
- package/src/components/ui/Photo.js +1 -1
- package/src/utils/InitParameters.js +12 -2
- package/tests/components/ui/__snapshots__/Map.test.js.snap +164 -0
- package/tests/utils/InitParameters.test.js +12 -0
|
@@ -106,6 +106,7 @@ Component properties. All of [Basic properties](Basic.md/#Panoramax.components.c
|
|
|
106
106
|
| [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)) |
|
|
107
107
|
| [lang] | <code>string</code> | | To override language used for labels. Defaults to using user's preferred languages. |
|
|
108
108
|
| [url-parameters] | <code>string</code> | <code>true</code> | Should the component add and update URL query parameters to save viewer state ? |
|
|
109
|
+
| [keyboard-shortcuts] | <code>string</code> | <code>true</code> | Should keyboard shortcuts be enabled ? Set to "false" to fully disable any keyboard shortcuts. |
|
|
109
110
|
|
|
110
111
|
<a name="Panoramax.components.core.PhotoViewer+onceReady"></a>
|
|
111
112
|
|
|
@@ -114,6 +114,7 @@ Component properties. All of [Basic properties](Basic.md/#Panoramax.components.c
|
|
|
114
114
|
| [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'}"` |
|
|
115
115
|
| [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'}"` |
|
|
116
116
|
| [url-parameters] | <code>string</code> | <code>true</code> | Should the component add and update URL query parameters to save viewer state ? |
|
|
117
|
+
| [keyboard-shortcuts] | <code>string</code> | <code>true</code> | Should keyboard shortcuts be enabled ? Set to "false" to fully disable any keyboard shortcuts. |
|
|
117
118
|
| [focus] | <code>string</code> | <code>"pic"</code> | The component showing up as main component (pic, map) |
|
|
118
119
|
| [geocoder] | <code>string</code> | <code>"nominatim"</code> | The geocoder engine to use (nominatim, ban, or URL to a standard [GeocodeJSON-compliant](https://github.com/geocoders/geocodejson-spec/blob/master/draft/README.md) API) |
|
|
119
120
|
| [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. |
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* [.displayPictureMarker(lon, lat, heading, [skipCenter])](#Panoramax.components.ui.Map+displayPictureMarker)
|
|
21
21
|
* [.reloadLayersStyles()](#Panoramax.components.ui.Map+reloadLayersStyles)
|
|
22
22
|
* [.addEventListener(type, listener)](#Panoramax.components.ui.Map+addEventListener)
|
|
23
|
+
* [.setVisibleUsers(visibleIds)](#Panoramax.components.ui.Map+setVisibleUsers)
|
|
23
24
|
* ["ready"](#Panoramax.components.ui.Map+event_ready)
|
|
24
25
|
* ["background-changed"](#Panoramax.components.ui.Map+event_background-changed)
|
|
25
26
|
* ["users-changed"](#Panoramax.components.ui.Map+event_users-changed)
|
|
@@ -180,6 +181,17 @@ This is a binder to [`on`](https://maplibre.org/maplibre-gl-js/docs/API/classes/
|
|
|
180
181
|
| listener | <code>function</code> | | The event handler |
|
|
181
182
|
| [options.once] | <code>boolean</code> | <code>false</code> | Set to true to only listen to first event. |
|
|
182
183
|
|
|
184
|
+
<a name="Panoramax.components.ui.Map+setVisibleUsers"></a>
|
|
185
|
+
|
|
186
|
+
### map.setVisibleUsers(visibleIds)
|
|
187
|
+
Make given user layers visible on map, and hide all others (if any)
|
|
188
|
+
|
|
189
|
+
**Kind**: instance method of [<code>Map</code>](#Panoramax.components.ui.Map)
|
|
190
|
+
|
|
191
|
+
| Param | Type | Description |
|
|
192
|
+
| --- | --- | --- |
|
|
193
|
+
| visibleIds | <code>string</code> \| <code>Array.<string></code> | The user layers IDs to display |
|
|
194
|
+
|
|
183
195
|
<a name="Panoramax.components.ui.Map+event_ready"></a>
|
|
184
196
|
|
|
185
197
|
### "ready"
|
|
@@ -128,6 +128,7 @@ Wait for a given map layer to be really available.
|
|
|
128
128
|
Make given user layers visible on map, and hide all others (if any)
|
|
129
129
|
|
|
130
130
|
**Kind**: instance method of [<code>MapMore</code>](#Panoramax.components.ui.MapMore)
|
|
131
|
+
**Overrides**: [<code>setVisibleUsers</code>](Map.md/#Panoramax.components.ui.Map+setVisibleUsers)
|
|
131
132
|
|
|
132
133
|
| Param | Type | Description |
|
|
133
134
|
| --- | --- | --- |
|
package/package.json
CHANGED
|
@@ -85,11 +85,13 @@ export default class PhotoViewer extends Basic {
|
|
|
85
85
|
* @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))
|
|
86
86
|
* @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.
|
|
87
87
|
* @property {string} [url-parameters=true] Should the component add and update URL query parameters to save viewer state ?
|
|
88
|
+
* @property {string} [keyboard-shortcuts=true] Should keyboard shortcuts be enabled ? Set to "false" to fully disable any keyboard shortcuts.
|
|
88
89
|
*/
|
|
89
90
|
static properties = {
|
|
90
91
|
psv: {converter: Basic.GetJSONConverter()},
|
|
91
92
|
widgets: {type: String},
|
|
92
93
|
"url-parameters": {type: String},
|
|
94
|
+
"keyboard-shortcuts": {type: String},
|
|
93
95
|
...Basic.properties
|
|
94
96
|
};
|
|
95
97
|
|
|
@@ -99,6 +101,7 @@ export default class PhotoViewer extends Basic {
|
|
|
99
101
|
// Defaults
|
|
100
102
|
this.psv = {};
|
|
101
103
|
this["url-parameters"] = this.getAttribute("url-parameters") || true;
|
|
104
|
+
this["keyboard-shortcuts"] = this.getAttribute("keyboard-shortcuts") || true;
|
|
102
105
|
this.widgets = this.getAttribute("widgets") || "true";
|
|
103
106
|
|
|
104
107
|
// Init DOM containers
|
|
@@ -266,7 +269,10 @@ export default class PhotoViewer extends Basic {
|
|
|
266
269
|
this._initPSV();
|
|
267
270
|
this._initWidgets();
|
|
268
271
|
alterPhotoViewerState(this, myPostInitParams);
|
|
269
|
-
|
|
272
|
+
|
|
273
|
+
if(myPostInitParams.keyboardShortcuts) {
|
|
274
|
+
this._handleKeyboardManagement();
|
|
275
|
+
}
|
|
270
276
|
|
|
271
277
|
if(myPostInitParams.picture) {
|
|
272
278
|
this.psv.addEventListener("picture-loaded", () => this.loader.dismiss(), {once: true});
|
|
@@ -95,6 +95,7 @@ export default class Viewer extends PhotoViewer {
|
|
|
95
95
|
* @property {object} [map] An object with [any map option available in Map or MapMore class](#Panoramax.components.ui.MapMore).<br />Example: `map="{'background': 'aerial', 'theme': 'age'}"`
|
|
96
96
|
* @property {object} [psv] [Any option to pass to Photo component](#Panoramax.components.ui.Photo) as an object.<br />Example: `psv="{'transitionDuration': 500, 'picturesNavigation': 'pic'}"`
|
|
97
97
|
* @property {string} [url-parameters=true] Should the component add and update URL query parameters to save viewer state ?
|
|
98
|
+
* @property {string} [keyboard-shortcuts=true] Should keyboard shortcuts be enabled ? Set to "false" to fully disable any keyboard shortcuts.
|
|
98
99
|
* @property {string} [focus=pic] The component showing up as main component (pic, map)
|
|
99
100
|
* @property {string} [geocoder=nominatim] The geocoder engine to use (nominatim, ban, or URL to a standard [GeocodeJSON-compliant](https://github.com/geocoders/geocodejson-spec/blob/master/draft/README.md) API)
|
|
100
101
|
* @property {string} [widgets=true] Use default set of widgets ? Set to false to avoid any widget to show up, and use slots to populate as you like.
|
|
@@ -321,7 +322,10 @@ export default class Viewer extends PhotoViewer {
|
|
|
321
322
|
this._moveChildToGrid();
|
|
322
323
|
|
|
323
324
|
alterViewerState(this, myPostInitParams);
|
|
324
|
-
|
|
325
|
+
|
|
326
|
+
if(myPostInitParams.keyboardShortcuts) {
|
|
327
|
+
this._handleKeyboardManagement();
|
|
328
|
+
}
|
|
325
329
|
|
|
326
330
|
if(myPostInitParams.picture) {
|
|
327
331
|
this.psv.addEventListener("picture-loaded", () => {
|
package/src/components/ui/Map.js
CHANGED
|
@@ -198,32 +198,21 @@ export default class MapMore extends Map {
|
|
|
198
198
|
return s;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
/**
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
* @param {string} [filters.minDate] Start date for pictures (format YYYY-MM-DD)
|
|
205
|
-
* @param {string} [filters.maxDate] End date for pictures (format YYYY-MM-DD)
|
|
206
|
-
* @param {string} [filters.pic_type] Type of picture to keep (flat, equirectangular)
|
|
207
|
-
* @param {string} [filters.camera] Camera make and model to keep
|
|
208
|
-
* @param {string} [filters.theme] Map theme to use
|
|
209
|
-
* @param {number[]} [filters.qualityscore] QualityScore values, as a list of 1 to 5 grades
|
|
210
|
-
* @param {boolean} [skipZoomIn=false] If true, doesn't force zoom in to map level >= 7
|
|
211
|
-
* @memberof Panoramax.components.core.MapMore#
|
|
212
|
-
*/
|
|
213
|
-
setFilters(filters, skipZoomIn = false) {
|
|
201
|
+
/** @private */
|
|
202
|
+
_mapFiltersToLayersFilters(filters) {
|
|
203
|
+
let mapFilters = {};
|
|
214
204
|
let mapSeqFilters = [];
|
|
215
205
|
let mapPicFilters = [];
|
|
216
206
|
let reloadMapStyle = false;
|
|
217
|
-
this._mapFilters = {};
|
|
218
207
|
|
|
219
208
|
if(filters.minDate && filters.minDate !== "") {
|
|
220
|
-
|
|
209
|
+
mapFilters.minDate = filters.minDate;
|
|
221
210
|
mapSeqFilters.push([">=", ["get", "date"], filters.minDate]);
|
|
222
211
|
mapPicFilters.push([">=", ["get", "ts"], filters.minDate]);
|
|
223
212
|
}
|
|
224
213
|
|
|
225
214
|
if(filters.maxDate && filters.maxDate !== "") {
|
|
226
|
-
|
|
215
|
+
mapFilters.maxDate = filters.maxDate;
|
|
227
216
|
mapSeqFilters.push(["<=", ["get", "date"], filters.maxDate]);
|
|
228
217
|
|
|
229
218
|
// Get tomorrow date for pictures filtering
|
|
@@ -235,16 +224,16 @@ export default class MapMore extends Map {
|
|
|
235
224
|
}
|
|
236
225
|
|
|
237
226
|
if(filters.pic_type && filters.pic_type !== "") {
|
|
238
|
-
|
|
239
|
-
mapSeqFilters.push(["==", ["get", "type"],
|
|
240
|
-
mapPicFilters.push(["==", ["get", "type"],
|
|
227
|
+
mapFilters.pic_type = filters.pic_type === "flat" ? "flat" : "equirectangular";
|
|
228
|
+
mapSeqFilters.push(["==", ["get", "type"], mapFilters.pic_type]);
|
|
229
|
+
mapPicFilters.push(["==", ["get", "type"], mapFilters.pic_type]);
|
|
241
230
|
}
|
|
242
231
|
if(this._hasGridStats()) {
|
|
243
232
|
reloadMapStyle = true;
|
|
244
233
|
}
|
|
245
234
|
|
|
246
235
|
if(filters.camera && filters.camera !== "") {
|
|
247
|
-
|
|
236
|
+
mapFilters.camera = filters.camera;
|
|
248
237
|
// low/high model hack : to enable fuzzy filtering of camera make and model
|
|
249
238
|
const lowModel = filters.camera.toLowerCase().trim() + " ";
|
|
250
239
|
const highModel = filters.camera.toLowerCase().trim() + "zzzzzzzzzzzzzzzzzzzz";
|
|
@@ -256,13 +245,13 @@ export default class MapMore extends Map {
|
|
|
256
245
|
}
|
|
257
246
|
|
|
258
247
|
if(filters.qualityscore && filters.qualityscore.length > 0) {
|
|
259
|
-
|
|
260
|
-
mapSeqFilters.push(["in", MAP_EXPR_QUALITYSCORE, ["literal",
|
|
261
|
-
mapPicFilters.push(["in", MAP_EXPR_QUALITYSCORE, ["literal",
|
|
248
|
+
mapFilters.qualityscore = filters.qualityscore;
|
|
249
|
+
mapSeqFilters.push(["in", MAP_EXPR_QUALITYSCORE, ["literal", mapFilters.qualityscore]]);
|
|
250
|
+
mapPicFilters.push(["in", MAP_EXPR_QUALITYSCORE, ["literal", mapFilters.qualityscore]]);
|
|
262
251
|
}
|
|
263
252
|
|
|
264
253
|
if(filters.theme && Object.values(MAP_THEMES).includes(filters.theme)) {
|
|
265
|
-
|
|
254
|
+
mapFilters.theme = filters.theme;
|
|
266
255
|
reloadMapStyle = true;
|
|
267
256
|
}
|
|
268
257
|
|
|
@@ -280,6 +269,25 @@ export default class MapMore extends Map {
|
|
|
280
269
|
];
|
|
281
270
|
}
|
|
282
271
|
|
|
272
|
+
return { mapFilters, mapSeqFilters, mapPicFilters, reloadMapStyle };
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Change the map filters
|
|
277
|
+
* @param {object} filters Filtering values
|
|
278
|
+
* @param {string} [filters.minDate] Start date for pictures (format YYYY-MM-DD)
|
|
279
|
+
* @param {string} [filters.maxDate] End date for pictures (format YYYY-MM-DD)
|
|
280
|
+
* @param {string} [filters.pic_type] Type of picture to keep (flat, equirectangular)
|
|
281
|
+
* @param {string} [filters.camera] Camera make and model to keep
|
|
282
|
+
* @param {string} [filters.theme] Map theme to use
|
|
283
|
+
* @param {number[]} [filters.qualityscore] QualityScore values, as a list of 1 to 5 grades
|
|
284
|
+
* @param {boolean} [skipZoomIn=false] If true, doesn't force zoom in to map level >= 7
|
|
285
|
+
* @memberof Panoramax.components.core.MapMore#
|
|
286
|
+
*/
|
|
287
|
+
setFilters(filters, skipZoomIn = false) {
|
|
288
|
+
let { mapFilters, mapSeqFilters, mapPicFilters, reloadMapStyle } = this._mapFiltersToLayersFilters(filters);
|
|
289
|
+
|
|
290
|
+
this._mapFilters = mapFilters;
|
|
283
291
|
if(reloadMapStyle) {
|
|
284
292
|
this.reloadLayersStyles();
|
|
285
293
|
}
|
|
@@ -291,9 +299,10 @@ export default class MapMore extends Map {
|
|
|
291
299
|
7, mapSeqFilters
|
|
292
300
|
];
|
|
293
301
|
}
|
|
294
|
-
|
|
302
|
+
|
|
295
303
|
this.filterUserLayersContent("sequences", mapSeqFilters);
|
|
296
304
|
this.filterUserLayersContent("pictures", mapPicFilters);
|
|
305
|
+
|
|
297
306
|
if(
|
|
298
307
|
!skipZoomIn
|
|
299
308
|
&& (
|
|
@@ -321,4 +330,31 @@ export default class MapMore extends Map {
|
|
|
321
330
|
*/
|
|
322
331
|
this.fire("filters-changed", Object.assign({}, this._mapFilters));
|
|
323
332
|
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Make given user layers visible on map, and hide all others (if any)
|
|
336
|
+
* @memberof Panoramax.components.ui.Map#
|
|
337
|
+
* @param {string|string[]} visibleIds The user layers IDs to display
|
|
338
|
+
*/
|
|
339
|
+
async setVisibleUsers(visibleIds = []) {
|
|
340
|
+
await super.setVisibleUsers(visibleIds);
|
|
341
|
+
|
|
342
|
+
// Force reload of styles & filters
|
|
343
|
+
let { mapSeqFilters, mapPicFilters, reloadMapStyle } = this._mapFiltersToLayersFilters(this._mapFilters);
|
|
344
|
+
|
|
345
|
+
if(reloadMapStyle) {
|
|
346
|
+
this.reloadLayersStyles();
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const allUsers = visibleIds.includes("geovisio");
|
|
350
|
+
if(mapSeqFilters && allUsers) {
|
|
351
|
+
mapSeqFilters = ["step", ["zoom"],
|
|
352
|
+
true,
|
|
353
|
+
7, mapSeqFilters
|
|
354
|
+
];
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
this.filterUserLayersContent("sequences", mapSeqFilters);
|
|
358
|
+
this.filterUserLayersContent("pictures", mapPicFilters);
|
|
359
|
+
}
|
|
324
360
|
}
|
|
@@ -953,7 +953,7 @@ export default class Photo extends PSViewer {
|
|
|
953
953
|
if(!visible) { this._myMarkers.clearMarkers(); }
|
|
954
954
|
else {
|
|
955
955
|
let annotations = meta.properties.annotations;
|
|
956
|
-
if(annotations
|
|
956
|
+
if(annotations?.length === 0) { console.warn("No annotation available on picture", meta.id); }
|
|
957
957
|
|
|
958
958
|
const picBData = this.state.textureData.panoData?.baseData;
|
|
959
959
|
|
|
@@ -15,7 +15,7 @@ const MAPLIBRE_OPTIONS = [
|
|
|
15
15
|
"boxZoom", "clickTolerance", "collectResourceTiming",
|
|
16
16
|
"cooperativeGestures", "crossSourceCollisions", "doubleClickZoom", "dragPan",
|
|
17
17
|
"dragRotate", "fadeDuration", "failIfMajorPerformanceCaveat", "fitBoundsOptions",
|
|
18
|
-
"hash", "interactive", "
|
|
18
|
+
"hash", "interactive", "localIdeographFontFamily", "locale", "logoPosition",
|
|
19
19
|
"maplibreLogo", "maxBounds", "maxCanvasSize", "maxPitch", "maxTileCacheSize",
|
|
20
20
|
"maxTileCacheZoomLevels", "maxZoom", "minPitch", "minZoom", "pitch", "pitchWithRotate",
|
|
21
21
|
"pixelRatio", "preserveDrawingBuffer", "refreshExpiredTiles", "renderWorldCopies",
|
|
@@ -80,6 +80,7 @@ export default class InitParameters { // eslint-disable-line import/no-unused-mo
|
|
|
80
80
|
let map_raster = componentMap.raster;
|
|
81
81
|
let map_attribution = componentMap.attributionControl;
|
|
82
82
|
let map_others = filterMapLibreOptions(componentMap);
|
|
83
|
+
let keyboardShortcuts = componentAttrs["keyboard-shortcuts"];
|
|
83
84
|
|
|
84
85
|
// - URL only
|
|
85
86
|
let psv_xyz = urlParams.xyz;
|
|
@@ -108,13 +109,14 @@ export default class InitParameters { // eslint-disable-line import/no-unused-mo
|
|
|
108
109
|
|
|
109
110
|
// Put all attributes in appropriate container
|
|
110
111
|
this._parentInit = { map, users, fetchOptions, style, lang, endpoint };
|
|
111
|
-
this._parentPostInit = { focus, picture, sequence, geocoder, widgets, forceFocus: true };
|
|
112
|
+
this._parentPostInit = { focus, picture, sequence, geocoder, widgets, forceFocus: true, keyboardShortcuts: true };
|
|
112
113
|
|
|
113
114
|
this._psvInit = Object.fromEntries(
|
|
114
115
|
Object.entries(componentPsv).filter(
|
|
115
116
|
([k,]) => !["transitionDuration", "picturesNavigation"].includes(k)
|
|
116
117
|
)
|
|
117
118
|
);
|
|
119
|
+
|
|
118
120
|
this._psvAny = {
|
|
119
121
|
transitionDuration: psv_speed,
|
|
120
122
|
picturesNavigation: psv_nav,
|
|
@@ -126,6 +128,7 @@ export default class InitParameters { // eslint-disable-line import/no-unused-mo
|
|
|
126
128
|
attributionControl: map_attribution,
|
|
127
129
|
...map_others
|
|
128
130
|
};
|
|
131
|
+
|
|
129
132
|
this._mapAny = {
|
|
130
133
|
theme: map_theme,
|
|
131
134
|
background: map_background,
|
|
@@ -142,6 +145,13 @@ export default class InitParameters { // eslint-disable-line import/no-unused-mo
|
|
|
142
145
|
camera: map_camera,
|
|
143
146
|
pic_score: map_pic_score,
|
|
144
147
|
};
|
|
148
|
+
|
|
149
|
+
if(keyboardShortcuts === "false") {
|
|
150
|
+
this._psvInit.keyboard = false;
|
|
151
|
+
this._psvInit.keyboardActions = {};
|
|
152
|
+
this._mapInit.keyboard = false;
|
|
153
|
+
this._parentPostInit.keyboardShortcuts = false;
|
|
154
|
+
}
|
|
145
155
|
}
|
|
146
156
|
|
|
147
157
|
/**
|
|
@@ -736,5 +736,169 @@ Array [
|
|
|
736
736
|
"visibility",
|
|
737
737
|
"none",
|
|
738
738
|
],
|
|
739
|
+
Array [
|
|
740
|
+
"geovisio_blabla_pictures",
|
|
741
|
+
"circle-sort-key",
|
|
742
|
+
Array [
|
|
743
|
+
"case",
|
|
744
|
+
Array [
|
|
745
|
+
"==",
|
|
746
|
+
Array [
|
|
747
|
+
"get",
|
|
748
|
+
"hidden",
|
|
749
|
+
],
|
|
750
|
+
true,
|
|
751
|
+
],
|
|
752
|
+
90,
|
|
753
|
+
10,
|
|
754
|
+
],
|
|
755
|
+
],
|
|
756
|
+
Array [
|
|
757
|
+
"geovisio_pictures",
|
|
758
|
+
"circle-sort-key",
|
|
759
|
+
Array [
|
|
760
|
+
"case",
|
|
761
|
+
Array [
|
|
762
|
+
"==",
|
|
763
|
+
Array [
|
|
764
|
+
"get",
|
|
765
|
+
"hidden",
|
|
766
|
+
],
|
|
767
|
+
true,
|
|
768
|
+
],
|
|
769
|
+
90,
|
|
770
|
+
10,
|
|
771
|
+
],
|
|
772
|
+
],
|
|
773
|
+
Array [
|
|
774
|
+
"geovisio_blabla_pictures_symbols",
|
|
775
|
+
"icon-image",
|
|
776
|
+
Array [
|
|
777
|
+
"case",
|
|
778
|
+
Array [
|
|
779
|
+
"==",
|
|
780
|
+
Array [
|
|
781
|
+
"get",
|
|
782
|
+
"id",
|
|
783
|
+
],
|
|
784
|
+
undefined,
|
|
785
|
+
],
|
|
786
|
+
"",
|
|
787
|
+
Array [
|
|
788
|
+
"==",
|
|
789
|
+
Array [
|
|
790
|
+
"get",
|
|
791
|
+
"type",
|
|
792
|
+
],
|
|
793
|
+
"equirectangular",
|
|
794
|
+
],
|
|
795
|
+
"pnx-arrow-360",
|
|
796
|
+
"pnx-arrow-flat",
|
|
797
|
+
],
|
|
798
|
+
],
|
|
799
|
+
Array [
|
|
800
|
+
"geovisio_blabla_pictures_symbols",
|
|
801
|
+
"symbol-sort-key",
|
|
802
|
+
Array [
|
|
803
|
+
"case",
|
|
804
|
+
Array [
|
|
805
|
+
"==",
|
|
806
|
+
Array [
|
|
807
|
+
"get",
|
|
808
|
+
"hidden",
|
|
809
|
+
],
|
|
810
|
+
true,
|
|
811
|
+
],
|
|
812
|
+
90,
|
|
813
|
+
10,
|
|
814
|
+
],
|
|
815
|
+
],
|
|
816
|
+
Array [
|
|
817
|
+
"geovisio_pictures_symbols",
|
|
818
|
+
"icon-image",
|
|
819
|
+
Array [
|
|
820
|
+
"case",
|
|
821
|
+
Array [
|
|
822
|
+
"==",
|
|
823
|
+
Array [
|
|
824
|
+
"get",
|
|
825
|
+
"id",
|
|
826
|
+
],
|
|
827
|
+
undefined,
|
|
828
|
+
],
|
|
829
|
+
"",
|
|
830
|
+
Array [
|
|
831
|
+
"==",
|
|
832
|
+
Array [
|
|
833
|
+
"get",
|
|
834
|
+
"type",
|
|
835
|
+
],
|
|
836
|
+
"equirectangular",
|
|
837
|
+
],
|
|
838
|
+
"pnx-arrow-360",
|
|
839
|
+
"pnx-arrow-flat",
|
|
840
|
+
],
|
|
841
|
+
],
|
|
842
|
+
Array [
|
|
843
|
+
"geovisio_pictures_symbols",
|
|
844
|
+
"symbol-sort-key",
|
|
845
|
+
Array [
|
|
846
|
+
"case",
|
|
847
|
+
Array [
|
|
848
|
+
"==",
|
|
849
|
+
Array [
|
|
850
|
+
"get",
|
|
851
|
+
"hidden",
|
|
852
|
+
],
|
|
853
|
+
true,
|
|
854
|
+
],
|
|
855
|
+
90,
|
|
856
|
+
10,
|
|
857
|
+
],
|
|
858
|
+
],
|
|
859
|
+
Array [
|
|
860
|
+
"geovisio_blabla_sequences",
|
|
861
|
+
"line-sort-key",
|
|
862
|
+
Array [
|
|
863
|
+
"case",
|
|
864
|
+
Array [
|
|
865
|
+
"==",
|
|
866
|
+
Array [
|
|
867
|
+
"get",
|
|
868
|
+
"hidden",
|
|
869
|
+
],
|
|
870
|
+
true,
|
|
871
|
+
],
|
|
872
|
+
90,
|
|
873
|
+
10,
|
|
874
|
+
],
|
|
875
|
+
],
|
|
876
|
+
Array [
|
|
877
|
+
"geovisio_blabla_sequences",
|
|
878
|
+
"line-cap",
|
|
879
|
+
"square",
|
|
880
|
+
],
|
|
881
|
+
Array [
|
|
882
|
+
"geovisio_sequences",
|
|
883
|
+
"line-sort-key",
|
|
884
|
+
Array [
|
|
885
|
+
"case",
|
|
886
|
+
Array [
|
|
887
|
+
"==",
|
|
888
|
+
Array [
|
|
889
|
+
"get",
|
|
890
|
+
"hidden",
|
|
891
|
+
],
|
|
892
|
+
true,
|
|
893
|
+
],
|
|
894
|
+
90,
|
|
895
|
+
10,
|
|
896
|
+
],
|
|
897
|
+
],
|
|
898
|
+
Array [
|
|
899
|
+
"geovisio_sequences",
|
|
900
|
+
"line-cap",
|
|
901
|
+
"square",
|
|
902
|
+
],
|
|
739
903
|
]
|
|
740
904
|
`;
|
|
@@ -66,6 +66,7 @@ describe("InitParameters", () => {
|
|
|
66
66
|
geocoder: true,
|
|
67
67
|
widgets: true,
|
|
68
68
|
forceFocus: true,
|
|
69
|
+
keyboardShortcuts: true,
|
|
69
70
|
});
|
|
70
71
|
expect(initParams._psvInit).toEqual({});
|
|
71
72
|
expect(initParams._psvAny).toEqual({
|
|
@@ -111,6 +112,7 @@ describe("InitParameters", () => {
|
|
|
111
112
|
geocoder: true,
|
|
112
113
|
widgets: true,
|
|
113
114
|
forceFocus: true,
|
|
115
|
+
keyboardShortcuts: true,
|
|
114
116
|
});
|
|
115
117
|
});
|
|
116
118
|
|
|
@@ -161,6 +163,7 @@ describe("InitParameters", () => {
|
|
|
161
163
|
geocoder: true,
|
|
162
164
|
widgets: true,
|
|
163
165
|
forceFocus: true,
|
|
166
|
+
keyboardShortcuts: true,
|
|
164
167
|
});
|
|
165
168
|
});
|
|
166
169
|
|
|
@@ -243,6 +246,15 @@ describe("InitParameters", () => {
|
|
|
243
246
|
expect(initParams._mapAny.background).toBe("streets");
|
|
244
247
|
expect(console.warn).toHaveBeenCalledWith("Parameter background can't be 'aerial' as no aerial imagery is available");
|
|
245
248
|
});
|
|
249
|
+
|
|
250
|
+
it("should handle keyboardShortcuts=false", () => {
|
|
251
|
+
componentAttrs["keyboard-shortcuts"] = "false";
|
|
252
|
+
const initParams = new InitParameters(componentAttrs, urlParams);
|
|
253
|
+
expect(initParams._mapInit.keyboard).toBe(false);
|
|
254
|
+
expect(initParams._parentPostInit.keyboardShortcuts).toBe(false);
|
|
255
|
+
expect(initParams._psvInit.keyboard).toBe(false);
|
|
256
|
+
expect(initParams._psvInit.keyboardActions).toEqual({});
|
|
257
|
+
});
|
|
246
258
|
});
|
|
247
259
|
|
|
248
260
|
describe("getMapPositionFromString", () => {
|