@disy/cadenza.js 10.2.1 → 10.2.2
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 +7 -0
- package/apidoc/assets/navigation.js +1 -1
- package/apidoc/assets/search.js +1 -1
- package/apidoc/classes/AbortError.html +3 -3
- package/apidoc/classes/CadenzaClient.html +26 -26
- package/apidoc/classes/CadenzaError.html +5 -5
- package/apidoc/functions/cadenza.html +3 -3
- package/apidoc/index.html +7 -4
- package/apidoc/interfaces/CadenzaClientOptions.html +5 -5
- package/apidoc/interfaces/CadenzaEvent.html +4 -4
- package/apidoc/interfaces/Distance.html +2 -2
- package/apidoc/interfaces/ExternalLinkKey.html +4 -4
- package/apidoc/interfaces/Feature.html +7 -7
- package/apidoc/interfaces/FeatureCollection.html +3 -3
- package/apidoc/interfaces/Geometry.html +3 -3
- package/apidoc/interfaces/GeometryZoomTarget.html +3 -3
- package/apidoc/interfaces/PageSource.html +3 -3
- package/apidoc/modules.html +3 -2
- package/apidoc/types/CadenzaActionEvent.html +2 -2
- package/apidoc/types/CadenzaChangeSelectionEvent.html +2 -2
- package/apidoc/types/CadenzaDrillThroughEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryCancelEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryOkEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryUpdateEvent.html +2 -2
- package/apidoc/types/CadenzaErrorEvent.html +2 -2
- package/apidoc/types/CadenzaEventByType.html +1 -1
- package/apidoc/types/CadenzaEventType.html +2 -2
- package/apidoc/types/CadenzaObjectInfoEvent.html +2 -2
- package/apidoc/types/CadenzaReloadEvent.html +5 -0
- package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +2 -2
- package/apidoc/types/CadenzaSelectObjectsOkEvent.html +2 -2
- package/apidoc/types/CustomValidityType.html +2 -2
- package/apidoc/types/DataType.html +2 -2
- package/apidoc/types/EmbeddingTargetId.html +2 -2
- package/apidoc/types/Extent.html +2 -2
- package/apidoc/types/FilterVariables.html +2 -2
- package/apidoc/types/GeometryType.html +2 -2
- package/apidoc/types/GlobalId.html +2 -2
- package/apidoc/types/LengthUnit.html +1 -1
- package/apidoc/types/OpaqueString.html +2 -2
- package/apidoc/types/OperationMode.html +2 -2
- package/apidoc/types/TablePart.html +2 -2
- package/apidoc/types/UiFeature.html +3 -2
- package/apidoc/types/WorkbookLayerPath.html +2 -2
- package/apidoc/types/ZoomTarget.html +2 -2
- package/cadenza.d.ts +50 -5
- package/cadenza.js +37 -5
- package/package.json +1 -1
- package/sandbox.html +26 -12
package/cadenza.d.ts
CHANGED
|
@@ -205,6 +205,12 @@ export class CadenzaClient {
|
|
|
205
205
|
* @postMessage
|
|
206
206
|
*/
|
|
207
207
|
removeSelection(layer: WorkbookLayerPath | string, values: unknown[][], ...args: any[]): Promise<void>;
|
|
208
|
+
/**
|
|
209
|
+
* @typedef {Object} LayerDefinition
|
|
210
|
+
* @property {string} name - The layer's name.
|
|
211
|
+
* @property {'geojson'} type - The layer's type.
|
|
212
|
+
* @property {FeatureCollection} content - The layer's content in geojson format.
|
|
213
|
+
*/
|
|
208
214
|
/**
|
|
209
215
|
* Create a geometry.
|
|
210
216
|
*
|
|
@@ -214,6 +220,7 @@ export class CadenzaClient {
|
|
|
214
220
|
* @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
|
|
215
221
|
* @param {GeometryType} geometryType - The geometry type
|
|
216
222
|
* @param {object} [options] - Options
|
|
223
|
+
* @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
|
|
217
224
|
* @param {FilterVariables} [options.filter] - Filter variables
|
|
218
225
|
* @param {string} [options.locationFinder] - A search query for the location finder
|
|
219
226
|
* @param {Extent} [options.mapExtent] - A map extent to set
|
|
@@ -221,6 +228,7 @@ export class CadenzaClient {
|
|
|
221
228
|
* @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
|
|
222
229
|
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
223
230
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
231
|
+
* @param {LayerDefinition[]} [options.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing.
|
|
224
232
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
225
233
|
* @throws For invalid arguments
|
|
226
234
|
* @fires
|
|
@@ -229,7 +237,8 @@ export class CadenzaClient {
|
|
|
229
237
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
230
238
|
* @embed
|
|
231
239
|
*/
|
|
232
|
-
createGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, }?: {
|
|
240
|
+
createGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { disabledUiFeatures, filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, additionalLayers, }?: {
|
|
241
|
+
disabledUiFeatures?: UiFeature[] | undefined;
|
|
233
242
|
filter?: FilterVariables | undefined;
|
|
234
243
|
locationFinder?: string | undefined;
|
|
235
244
|
mapExtent?: Extent | undefined;
|
|
@@ -237,6 +246,20 @@ export class CadenzaClient {
|
|
|
237
246
|
useMapSrs?: boolean | undefined;
|
|
238
247
|
operationMode?: OperationMode | undefined;
|
|
239
248
|
signal?: AbortSignal | undefined;
|
|
249
|
+
additionalLayers?: {
|
|
250
|
+
/**
|
|
251
|
+
* - The layer's name.
|
|
252
|
+
*/
|
|
253
|
+
name: string;
|
|
254
|
+
/**
|
|
255
|
+
* - The layer's type.
|
|
256
|
+
*/
|
|
257
|
+
type: 'geojson';
|
|
258
|
+
/**
|
|
259
|
+
* - The layer's content in geojson format.
|
|
260
|
+
*/
|
|
261
|
+
content: FeatureCollection;
|
|
262
|
+
}[] | undefined;
|
|
240
263
|
} | undefined, ...args: any[]): Promise<void>;
|
|
241
264
|
/**
|
|
242
265
|
* Edit a geometry.
|
|
@@ -244,6 +267,7 @@ export class CadenzaClient {
|
|
|
244
267
|
* @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
|
|
245
268
|
* @param {Geometry} geometry - The geometry
|
|
246
269
|
* @param {object} [options] - Options
|
|
270
|
+
* @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
|
|
247
271
|
* @param {FilterVariables} [options.filter] - Filter variables
|
|
248
272
|
* @param {string} [options.locationFinder] - A search query for the location finder
|
|
249
273
|
* @param {Extent} [options.mapExtent] - A map extent to set
|
|
@@ -252,6 +276,7 @@ export class CadenzaClient {
|
|
|
252
276
|
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
253
277
|
* @param {ZoomTarget} [options.zoomTarget] - A target Cadenza should zoom to
|
|
254
278
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
279
|
+
* @param {Object[]} [options.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing. Each is a layer definition, with name, type and content (a Geojson featureCollection).
|
|
255
280
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
256
281
|
* @throws For invalid arguments
|
|
257
282
|
* @fires
|
|
@@ -260,7 +285,8 @@ export class CadenzaClient {
|
|
|
260
285
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
261
286
|
* @embed
|
|
262
287
|
*/
|
|
263
|
-
editGeometry(backgroundMapView: EmbeddingTargetId, geometry: Geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, }?: {
|
|
288
|
+
editGeometry(backgroundMapView: EmbeddingTargetId, geometry: Geometry, { disabledUiFeatures, filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, additionalLayers, }?: {
|
|
289
|
+
disabledUiFeatures?: UiFeature[] | undefined;
|
|
264
290
|
filter?: FilterVariables | undefined;
|
|
265
291
|
locationFinder?: string | undefined;
|
|
266
292
|
mapExtent?: Extent | undefined;
|
|
@@ -269,6 +295,7 @@ export class CadenzaClient {
|
|
|
269
295
|
operationMode?: OperationMode | undefined;
|
|
270
296
|
zoomTarget?: GeometryZoomTarget | undefined;
|
|
271
297
|
signal?: AbortSignal | undefined;
|
|
298
|
+
additionalLayers?: Object[] | undefined;
|
|
272
299
|
} | undefined, ...args: any[]): Promise<void>;
|
|
273
300
|
/**
|
|
274
301
|
* Set custom validity state of the geometry editor in addition to the default validation state (including errors and
|
|
@@ -419,6 +446,7 @@ export class CadenzaClient {
|
|
|
419
446
|
* | 'objectInfo'
|
|
420
447
|
* | 'selectObjects:ok'
|
|
421
448
|
* | 'selectObjects:cancel'
|
|
449
|
+
* | 'reload'
|
|
422
450
|
* } CadenzaEventType - An event type to subscribe to using {@link CadenzaClient#on}
|
|
423
451
|
*/
|
|
424
452
|
/**
|
|
@@ -432,6 +460,7 @@ export class CadenzaClient {
|
|
|
432
460
|
* : T extends 'objectInfo' ? CadenzaObjectInfoEvent
|
|
433
461
|
* : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent
|
|
434
462
|
* : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent
|
|
463
|
+
* : T extends 'reload' ? CadenzaReloadEvent
|
|
435
464
|
* : never
|
|
436
465
|
* } CadenzaEventByType
|
|
437
466
|
*/
|
|
@@ -470,6 +499,13 @@ export class CadenzaClient {
|
|
|
470
499
|
* For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
|
|
471
500
|
*/
|
|
472
501
|
/** @typedef {CadenzaEvent<'selectObjects:cancel'>} CadenzaSelectObjectsCancelEvent - When the user cancelled the selection. */
|
|
502
|
+
/**
|
|
503
|
+
* @typedef {CadenzaEvent<'reload'>} CadenzaReloadEvent - When the user clicked on the 'reload' button in the embedding standby page
|
|
504
|
+
*
|
|
505
|
+
* If a user does not interact with the iframe displaying the Cadenza content for a while, a standby embed page is displayed
|
|
506
|
+
* and the user can click a reload button there. Then the application using Cadenza JS can re-trigger the loading of the iframe
|
|
507
|
+
* with the correct original URL and parameters and do what was originally done when displaying that iframe.
|
|
508
|
+
*/
|
|
473
509
|
export class AbortError extends DOMException {
|
|
474
510
|
constructor();
|
|
475
511
|
}
|
|
@@ -578,9 +614,10 @@ export type OperationMode = 'normal' | 'simplified';
|
|
|
578
614
|
*
|
|
579
615
|
* _Note:_ Supported features are:
|
|
580
616
|
* * `"workbook-design"` - The workbook designer
|
|
617
|
+
* * `"workbook-map-add-layer"`- Add layers to the map
|
|
581
618
|
* * `"workbook-view-management"` - Add/Edit/Remove workbook views (Is included in 'workbook-design'.)
|
|
582
619
|
*/
|
|
583
|
-
export type UiFeature = 'workbook-design' | 'workbook-view-management';
|
|
620
|
+
export type UiFeature = 'workbook-design' | 'workbook-map-add-layer' | 'workbook-view-management';
|
|
584
621
|
export type Distance = {
|
|
585
622
|
value: number;
|
|
586
623
|
lengthUnit: LengthUnit;
|
|
@@ -678,8 +715,8 @@ export type CustomValidityType = 'error' | 'warning' | 'info' | 'success';
|
|
|
678
715
|
/**
|
|
679
716
|
* - An event type to subscribe to using {@link CadenzaClienton }
|
|
680
717
|
*/
|
|
681
|
-
export type CadenzaEventType = 'action' | 'change:selection' | 'drillThrough' | 'editGeometry:ok' | 'editGeometry:update' | 'editGeometry:cancel' | 'objectInfo' | 'selectObjects:ok' | 'selectObjects:cancel';
|
|
682
|
-
export type CadenzaEventByType<T extends CadenzaEventType> = T extends 'action' ? CadenzaActionEvent : T extends 'change:selection' ? CadenzaChangeSelectionEvent : T extends 'drillThrough' ? CadenzaDrillThroughEvent : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent : T extends 'objectInfo' ? CadenzaObjectInfoEvent : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent : never;
|
|
718
|
+
export type CadenzaEventType = 'action' | 'change:selection' | 'drillThrough' | 'editGeometry:ok' | 'editGeometry:update' | 'editGeometry:cancel' | 'objectInfo' | 'selectObjects:ok' | 'selectObjects:cancel' | 'reload';
|
|
719
|
+
export type CadenzaEventByType<T extends CadenzaEventType> = T extends 'action' ? CadenzaActionEvent : T extends 'change:selection' ? CadenzaChangeSelectionEvent : T extends 'drillThrough' ? CadenzaDrillThroughEvent : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent : T extends 'objectInfo' ? CadenzaObjectInfoEvent : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent : T extends 'reload' ? CadenzaReloadEvent : never;
|
|
683
720
|
/**
|
|
684
721
|
* - A Cadenza `postMessage()` event
|
|
685
722
|
*/
|
|
@@ -770,3 +807,11 @@ export type CadenzaSelectObjectsOkEvent = CadenzaEvent<'selectObjects:ok', {
|
|
|
770
807
|
* - When the user cancelled the selection.
|
|
771
808
|
*/
|
|
772
809
|
export type CadenzaSelectObjectsCancelEvent = CadenzaEvent<'selectObjects:cancel'>;
|
|
810
|
+
/**
|
|
811
|
+
* - When the user clicked on the 'reload' button in the embedding standby page
|
|
812
|
+
*
|
|
813
|
+
* If a user does not interact with the iframe displaying the Cadenza content for a while, a standby embed page is displayed
|
|
814
|
+
* and the user can click a reload button there. Then the application using Cadenza JS can re-trigger the loading of the iframe
|
|
815
|
+
* with the correct original URL and parameters and do what was originally done when displaying that iframe.
|
|
816
|
+
*/
|
|
817
|
+
export type CadenzaReloadEvent = CadenzaEvent<'reload'>;
|
package/cadenza.js
CHANGED
|
@@ -90,10 +90,11 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
|
|
|
90
90
|
*/
|
|
91
91
|
/** @typedef {'normal'|'simplified'} OperationMode - The mode in which a workbook should be operated */
|
|
92
92
|
/**
|
|
93
|
-
* @typedef {'workbook-design'|'workbook-view-management'} UiFeature - The name of a Cadenza UI feature
|
|
93
|
+
* @typedef {'workbook-design'|'workbook-map-add-layer'|'workbook-view-management'} UiFeature - The name of a Cadenza UI feature
|
|
94
94
|
*
|
|
95
95
|
* _Note:_ Supported features are:
|
|
96
96
|
* * `"workbook-design"` - The workbook designer
|
|
97
|
+
* * `"workbook-map-add-layer"`- Add layers to the map
|
|
97
98
|
* * `"workbook-view-management"` - Add/Edit/Remove workbook views (Is included in 'workbook-design'.)
|
|
98
99
|
* */
|
|
99
100
|
/**
|
|
@@ -456,6 +457,12 @@ export class CadenzaClient {
|
|
|
456
457
|
values,
|
|
457
458
|
});
|
|
458
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* @typedef {Object} LayerDefinition
|
|
462
|
+
* @property {string} name - The layer's name.
|
|
463
|
+
* @property {'geojson'} type - The layer's type.
|
|
464
|
+
* @property {FeatureCollection} content - The layer's content in geojson format.
|
|
465
|
+
*/
|
|
459
466
|
/**
|
|
460
467
|
* Create a geometry.
|
|
461
468
|
*
|
|
@@ -465,6 +472,7 @@ export class CadenzaClient {
|
|
|
465
472
|
* @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
|
|
466
473
|
* @param {GeometryType} geometryType - The geometry type
|
|
467
474
|
* @param {object} [options] - Options
|
|
475
|
+
* @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
|
|
468
476
|
* @param {FilterVariables} [options.filter] - Filter variables
|
|
469
477
|
* @param {string} [options.locationFinder] - A search query for the location finder
|
|
470
478
|
* @param {Extent} [options.mapExtent] - A map extent to set
|
|
@@ -472,6 +480,7 @@ export class CadenzaClient {
|
|
|
472
480
|
* @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
|
|
473
481
|
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
474
482
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
483
|
+
* @param {LayerDefinition[]} [options.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing.
|
|
475
484
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
476
485
|
* @throws For invalid arguments
|
|
477
486
|
* @fires
|
|
@@ -480,10 +489,11 @@ export class CadenzaClient {
|
|
|
480
489
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
481
490
|
* @embed
|
|
482
491
|
*/
|
|
483
|
-
createGeometry(backgroundMapView, geometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, } = {}) {
|
|
492
|
+
async createGeometry(backgroundMapView, geometryType, { disabledUiFeatures, filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, additionalLayers, } = {}) {
|
|
484
493
|
this.#log('CadenzaClient#createGeometry', ...arguments);
|
|
485
494
|
const params = createParams({
|
|
486
495
|
action: 'editGeometry',
|
|
496
|
+
disabledUiFeatures,
|
|
487
497
|
filter,
|
|
488
498
|
geometryType,
|
|
489
499
|
locationFinder,
|
|
@@ -492,7 +502,10 @@ export class CadenzaClient {
|
|
|
492
502
|
useMapSrs,
|
|
493
503
|
operationMode,
|
|
494
504
|
});
|
|
495
|
-
|
|
505
|
+
await this.#show(resolvePath(backgroundMapView), params, signal);
|
|
506
|
+
if (additionalLayers) {
|
|
507
|
+
additionalLayers.forEach((layer) => this.#postEvent('importLayer', layer));
|
|
508
|
+
}
|
|
496
509
|
}
|
|
497
510
|
/**
|
|
498
511
|
* Edit a geometry.
|
|
@@ -500,6 +513,7 @@ export class CadenzaClient {
|
|
|
500
513
|
* @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
|
|
501
514
|
* @param {Geometry} geometry - The geometry
|
|
502
515
|
* @param {object} [options] - Options
|
|
516
|
+
* @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
|
|
503
517
|
* @param {FilterVariables} [options.filter] - Filter variables
|
|
504
518
|
* @param {string} [options.locationFinder] - A search query for the location finder
|
|
505
519
|
* @param {Extent} [options.mapExtent] - A map extent to set
|
|
@@ -508,6 +522,7 @@ export class CadenzaClient {
|
|
|
508
522
|
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
509
523
|
* @param {ZoomTarget} [options.zoomTarget] - A target Cadenza should zoom to
|
|
510
524
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
525
|
+
* @param {Object[]} [options.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing. Each is a layer definition, with name, type and content (a Geojson featureCollection).
|
|
511
526
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
512
527
|
* @throws For invalid arguments
|
|
513
528
|
* @fires
|
|
@@ -516,12 +531,13 @@ export class CadenzaClient {
|
|
|
516
531
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
517
532
|
* @embed
|
|
518
533
|
*/
|
|
519
|
-
async editGeometry(backgroundMapView, geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, } = {}) {
|
|
534
|
+
async editGeometry(backgroundMapView, geometry, { disabledUiFeatures, filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, additionalLayers, } = {}) {
|
|
520
535
|
this.#log('CadenzaClient#editGeometry', ...arguments);
|
|
521
536
|
assertValidGeometryType(geometry.type);
|
|
522
537
|
const zoomToGeometry = geometry && zoomTarget?.type === 'geometry';
|
|
523
538
|
const params = createParams({
|
|
524
539
|
action: 'editGeometry',
|
|
540
|
+
disabledUiFeatures,
|
|
525
541
|
filter,
|
|
526
542
|
// only use locationFinder if zoom to geometry is not set, to avoid
|
|
527
543
|
// zooming race condition for Cadenza versions below 10.1
|
|
@@ -538,6 +554,9 @@ export class CadenzaClient {
|
|
|
538
554
|
zoomToGeometry,
|
|
539
555
|
});
|
|
540
556
|
}
|
|
557
|
+
if (additionalLayers) {
|
|
558
|
+
additionalLayers.forEach((layer) => this.#postEvent('importLayer', layer));
|
|
559
|
+
}
|
|
541
560
|
}
|
|
542
561
|
/**
|
|
543
562
|
* Set custom validity state of the geometry editor in addition to the default validation state (including errors and
|
|
@@ -995,7 +1014,11 @@ function validOperationMode(/** @type string */ value) {
|
|
|
995
1014
|
return ['normal', 'simplified'].includes(value);
|
|
996
1015
|
}
|
|
997
1016
|
function validUiFeature(/** @type string */ value) {
|
|
998
|
-
return [
|
|
1017
|
+
return [
|
|
1018
|
+
'workbook-design',
|
|
1019
|
+
'workbook-map-add-layer',
|
|
1020
|
+
'workbook-view-management',
|
|
1021
|
+
].includes(value);
|
|
999
1022
|
}
|
|
1000
1023
|
function assertSupportedDataType(
|
|
1001
1024
|
/** @type DataType */ type,
|
|
@@ -1086,6 +1109,7 @@ function array(/** @type unknown */ value) {
|
|
|
1086
1109
|
* | 'objectInfo'
|
|
1087
1110
|
* | 'selectObjects:ok'
|
|
1088
1111
|
* | 'selectObjects:cancel'
|
|
1112
|
+
* | 'reload'
|
|
1089
1113
|
* } CadenzaEventType - An event type to subscribe to using {@link CadenzaClient#on}
|
|
1090
1114
|
*/
|
|
1091
1115
|
/**
|
|
@@ -1099,6 +1123,7 @@ function array(/** @type unknown */ value) {
|
|
|
1099
1123
|
* : T extends 'objectInfo' ? CadenzaObjectInfoEvent
|
|
1100
1124
|
* : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent
|
|
1101
1125
|
* : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent
|
|
1126
|
+
* : T extends 'reload' ? CadenzaReloadEvent
|
|
1102
1127
|
* : never
|
|
1103
1128
|
* } CadenzaEventByType
|
|
1104
1129
|
*/
|
|
@@ -1142,6 +1167,13 @@ function array(/** @type unknown */ value) {
|
|
|
1142
1167
|
* For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
|
|
1143
1168
|
*/
|
|
1144
1169
|
/** @typedef {CadenzaEvent<'selectObjects:cancel'>} CadenzaSelectObjectsCancelEvent - When the user cancelled the selection. */
|
|
1170
|
+
/**
|
|
1171
|
+
* @typedef {CadenzaEvent<'reload'>} CadenzaReloadEvent - When the user clicked on the 'reload' button in the embedding standby page
|
|
1172
|
+
*
|
|
1173
|
+
* If a user does not interact with the iframe displaying the Cadenza content for a while, a standby embed page is displayed
|
|
1174
|
+
* and the user can click a reload button there. Then the application using Cadenza JS can re-trigger the loading of the iframe
|
|
1175
|
+
* with the correct original URL and parameters and do what was originally done when displaying that iframe.
|
|
1176
|
+
*/
|
|
1145
1177
|
export class AbortError extends DOMException {
|
|
1146
1178
|
constructor() {
|
|
1147
1179
|
super('Aborted', 'AbortError');
|
package/package.json
CHANGED
package/sandbox.html
CHANGED
|
@@ -231,7 +231,8 @@
|
|
|
231
231
|
fullGeometries,
|
|
232
232
|
zoomToGeometry,
|
|
233
233
|
distance,
|
|
234
|
-
lengthUnit
|
|
234
|
+
lengthUnit,
|
|
235
|
+
additionalLayers
|
|
235
236
|
}) {
|
|
236
237
|
return {
|
|
237
238
|
disabledUiFeatures: disabledUiFeatures && disabledUiFeatures.split(','),
|
|
@@ -253,7 +254,8 @@
|
|
|
253
254
|
useMapSrs: useMapSrs === 'on',
|
|
254
255
|
fullGeometries: fullGeometries === 'on',
|
|
255
256
|
zoomTarget: zoomToGeometry === 'on' ? { type: 'geometry' } : undefined,
|
|
256
|
-
buffer: distance ? { value: Number(distance), lengthUnit: lengthUnit ? lengthUnit : 'm' } : undefined
|
|
257
|
+
buffer: distance ? { value: Number(distance), lengthUnit: lengthUnit ? lengthUnit : 'm' } : undefined,
|
|
258
|
+
additionalLayers: additionalLayers && JSON.parse(additionalLayers)
|
|
257
259
|
};
|
|
258
260
|
}
|
|
259
261
|
|
|
@@ -351,6 +353,15 @@
|
|
|
351
353
|
Simplified operation mode
|
|
352
354
|
</label>
|
|
353
355
|
</div>
|
|
356
|
+
<div>
|
|
357
|
+
<label>
|
|
358
|
+
<input type="checkbox" name="expandNavigator">
|
|
359
|
+
Expand navigator tree
|
|
360
|
+
</label>
|
|
361
|
+
</div>
|
|
362
|
+
</template>
|
|
363
|
+
|
|
364
|
+
<template id="common-disabledUiFeatures">
|
|
354
365
|
<div>
|
|
355
366
|
<label for="disabledUiFeatures">Disabled UI features</label>
|
|
356
367
|
<input name="disabledUiFeatures" id="disabledUiFeatures" placeholder="feature1,feature2,...">
|
|
@@ -361,16 +372,11 @@
|
|
|
361
372
|
Supported features:
|
|
362
373
|
<ul>
|
|
363
374
|
<li>workbook-design</li>
|
|
375
|
+
<li>workbook-map-add-layer</li>
|
|
364
376
|
<li>workbook-view-management</li>
|
|
365
377
|
</ul>
|
|
366
378
|
</small>
|
|
367
379
|
</div>
|
|
368
|
-
<div>
|
|
369
|
-
<label>
|
|
370
|
-
<input type="checkbox" name="expandNavigator">
|
|
371
|
-
Expand navigator tree
|
|
372
|
-
</label>
|
|
373
|
-
</div>
|
|
374
380
|
</template>
|
|
375
381
|
|
|
376
382
|
<template id="common-filter">
|
|
@@ -427,7 +433,7 @@
|
|
|
427
433
|
</div>
|
|
428
434
|
</template>
|
|
429
435
|
|
|
430
|
-
<template data-action="show" data-common="showWorkbook,filter,show">
|
|
436
|
+
<template data-action="show" data-common="showWorkbook,disabledUiFeatures,filter,show">
|
|
431
437
|
<div>
|
|
432
438
|
<label for="embeddingTargetId">Embedding target ID *</label>
|
|
433
439
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
@@ -463,7 +469,7 @@
|
|
|
463
469
|
</div>
|
|
464
470
|
</template>
|
|
465
471
|
|
|
466
|
-
<template data-action="showMap" data-common="zoomTo,map,showWorkbook,filter,show">
|
|
472
|
+
<template data-action="showMap" data-common="zoomTo,map,showWorkbook,disabledUiFeatures,filter,show">
|
|
467
473
|
<div>
|
|
468
474
|
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
469
475
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
@@ -490,11 +496,15 @@
|
|
|
490
496
|
|
|
491
497
|
<template data-action="setFilter" data-common="filter"></template>
|
|
492
498
|
|
|
493
|
-
<template data-action="createGeometry" data-common="map,filter">
|
|
499
|
+
<template data-action="createGeometry" data-common="map,disabledUiFeatures,filter">
|
|
494
500
|
<div>
|
|
495
501
|
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
496
502
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
497
503
|
</div>
|
|
504
|
+
<div>
|
|
505
|
+
<label for="geometry">Additional layers (GeoJSON)</label>
|
|
506
|
+
<textarea name="additionalLayers" id="additionalLayers" rows="10"></textarea>
|
|
507
|
+
</div>
|
|
498
508
|
<div>
|
|
499
509
|
<label for="geometryType">Geometry type</label>
|
|
500
510
|
<select name="geometryType" id="geometryType">
|
|
@@ -518,11 +528,15 @@
|
|
|
518
528
|
</div>
|
|
519
529
|
</template>
|
|
520
530
|
|
|
521
|
-
<template data-action="editGeometry" data-common="zoomTo,map,filter">
|
|
531
|
+
<template data-action="editGeometry" data-common="zoomTo,map,disabledUiFeatures,filter">
|
|
522
532
|
<div>
|
|
523
533
|
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
524
534
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
525
535
|
</div>
|
|
536
|
+
<div>
|
|
537
|
+
<label for="geometry">Additional layers (GeoJSON)</label>
|
|
538
|
+
<textarea name="additionalLayers" id="additionalLayers" rows="10"></textarea>
|
|
539
|
+
</div>
|
|
526
540
|
<div>
|
|
527
541
|
<label for="geometry">Geometry (GeoJSON) *</label>
|
|
528
542
|
<textarea name="geometry" id="geometry" rows="5" required></textarea>
|