@disy/cadenza.js 10.5.4 → 10.6.0
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 +19 -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 +71 -27
- package/apidoc/classes/CadenzaError.html +5 -5
- package/apidoc/functions/cadenza.html +4 -4
- package/apidoc/index.html +21 -21
- package/apidoc/interfaces/AreaIntersectionsResult.html +4 -4
- package/apidoc/interfaces/CadenzaClientOptions.html +6 -6
- package/apidoc/interfaces/CadenzaEvent.html +4 -4
- package/apidoc/interfaces/CommonEditGeometryOptions.html +13 -11
- package/apidoc/interfaces/Distance.html +2 -2
- package/apidoc/interfaces/ExternalLinkKey.html +4 -4
- package/apidoc/interfaces/Feature.html +9 -9
- package/apidoc/interfaces/FeatureCollection.html +4 -4
- package/apidoc/interfaces/Geometry.html +4 -4
- package/apidoc/interfaces/GeometryExtentStrategy.html +4 -4
- package/apidoc/interfaces/LayerDataExtentStrategy.html +4 -4
- package/apidoc/interfaces/LayerDefinition.html +4 -4
- package/apidoc/interfaces/LocationFinderExtentStrategy.html +4 -4
- package/apidoc/interfaces/PageSource.html +3 -3
- package/apidoc/interfaces/ProblemDetails.html +6 -6
- package/apidoc/interfaces/SnappingOptions.html +3 -3
- package/apidoc/interfaces/SpatialFilterValue.html +4 -4
- package/apidoc/interfaces/StaticExtentStrategy.html +4 -4
- package/apidoc/modules.html +1 -1
- package/apidoc/types/CadenzaActionEvent.html +2 -2
- package/apidoc/types/CadenzaChangeExtentEvent.html +3 -0
- package/apidoc/types/CadenzaChangeSelectionEvent.html +2 -2
- package/apidoc/types/CadenzaDrillThroughEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryCancelEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryCreateEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryDeleteEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryEditEvent.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/CadenzaReloadEvent.html +2 -2
- package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +2 -2
- package/apidoc/types/CadenzaSelectObjectsOkEvent.html +2 -2
- package/apidoc/types/Coordinate.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/ExtentStrategy.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/Layout.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/Polygon.html +1 -1
- package/apidoc/types/SpatialRelation.html +2 -2
- package/apidoc/types/TablePart.html +2 -2
- package/apidoc/types/UiFeature.html +2 -2
- package/apidoc/types/WorkbookLayerPath.html +2 -2
- package/apidoc/types/WorksheetPlaceholders.html +2 -2
- package/cadenza.d.ts +43 -16
- package/cadenza.js +88 -24
- package/package.json +3 -5
- package/sandbox.html +15 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WorkbookLayerPath | Cadenza JS - v10.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WorkbookLayerPath | Cadenza JS - v10.6.0</title><meta name="description" content="Documentation for Cadenza JS"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"><a href="https://github.com/DisyInformationssysteme/cadenza.js">Cadenza JS on GitHub</a></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Cadenza JS - v10.6.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Cadenza JS</a></li><li><a href="WorkbookLayerPath.html">WorkbookLayerPath</a></li></ul><h1>Type Alias WorkbookLayerPath</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">WorkbookLayerPath</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>Identifies a layer within a workbook map view
|
|
2
2
|
using the print names of the layer and - if the layer is grouped - its ancestors</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/DisyInformationssysteme/cadenza.js/blob/
|
|
3
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/DisyInformationssysteme/cadenza.js/blob/de62c3b4ea2e61fadcfbecc0ffac98e74ad60a04/src/cadenza.js#L106">src/cadenza.js:106</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav id="tsd-sidebar-links" class="tsd-navigation"><a href="https://github.com/DisyInformationssysteme/cadenza.js" class="tsd-nav-link">Cadenza JS on GitHub</a></nav><nav class="tsd-navigation"><a href="../modules.html">Cadenza JS - v10.6.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WorksheetPlaceholders | Cadenza JS - v10.
|
|
2
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/DisyInformationssysteme/cadenza.js/blob/
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WorksheetPlaceholders | Cadenza JS - v10.6.0</title><meta name="description" content="Documentation for Cadenza JS"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"><a href="https://github.com/DisyInformationssysteme/cadenza.js">Cadenza JS on GitHub</a></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Cadenza JS - v10.6.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Cadenza JS</a></li><li><a href="WorksheetPlaceholders.html">WorksheetPlaceholders</a></li></ul><h1>Type Alias WorksheetPlaceholders</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">WorksheetPlaceholders</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Maps the worksheet placeholder IDs in report embeddings to the print names of the worksheets to replace them with.</p>
|
|
2
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/DisyInformationssysteme/cadenza.js/blob/de62c3b4ea2e61fadcfbecc0ffac98e74ad60a04/src/cadenza.js#L242">src/cadenza.js:242</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav id="tsd-sidebar-links" class="tsd-navigation"><a href="https://github.com/DisyInformationssysteme/cadenza.js" class="tsd-nav-link">Cadenza JS on GitHub</a></nav><nav class="tsd-navigation"><a href="../modules.html">Cadenza JS - v10.6.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
package/cadenza.d.ts
CHANGED
|
@@ -121,6 +121,8 @@ export class CadenzaClient {
|
|
|
121
121
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
122
122
|
* @throws For invalid arguments
|
|
123
123
|
* @fires
|
|
124
|
+
* - {@link CadenzaChangeExtentEvent}
|
|
125
|
+
* - {@link CadenzaChangeSelectionEvent}
|
|
124
126
|
* - {@link CadenzaDrillThroughEvent}
|
|
125
127
|
* - {@link CadenzaActionEvent}
|
|
126
128
|
* @embed
|
|
@@ -168,7 +170,6 @@ export class CadenzaClient {
|
|
|
168
170
|
/**
|
|
169
171
|
* Set filter variables in the currently shown workbook.
|
|
170
172
|
*
|
|
171
|
-
* @hidden
|
|
172
173
|
* @param {FilterVariables} filter - The variable values
|
|
173
174
|
* @return {Promise<void>} A `Promise` for when the filter variables were set.
|
|
174
175
|
* @postMessage
|
|
@@ -180,7 +181,6 @@ export class CadenzaClient {
|
|
|
180
181
|
* When making a layer visible, its ancestors will be made visible, too.
|
|
181
182
|
* When hiding a layer, the ancestors are not affected.
|
|
182
183
|
*
|
|
183
|
-
* @hidden
|
|
184
184
|
* @param {WorkbookLayerPath | string} layer - The layer to show or hide
|
|
185
185
|
* (identified using a layer path or a print name)
|
|
186
186
|
* @param {boolean} visible - The visibility state of the layer
|
|
@@ -191,7 +191,6 @@ export class CadenzaClient {
|
|
|
191
191
|
/**
|
|
192
192
|
* Set the selection in the currently shown workbook map view.
|
|
193
193
|
*
|
|
194
|
-
* @hidden
|
|
195
194
|
* @param {WorkbookLayerPath | string} layer - The data view layer to set the selection in
|
|
196
195
|
* @param {unknown[][]} values - The IDs of the objects to select
|
|
197
196
|
* @param {object} [__namedParameters]
|
|
@@ -205,7 +204,6 @@ export class CadenzaClient {
|
|
|
205
204
|
/**
|
|
206
205
|
* Add to the selection in the currently shown workbook map view.
|
|
207
206
|
*
|
|
208
|
-
* @hidden
|
|
209
207
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
210
208
|
* @param {unknown[][]} values - The IDs of the objects to select
|
|
211
209
|
* @param {object} [__namedParameters]
|
|
@@ -219,7 +217,6 @@ export class CadenzaClient {
|
|
|
219
217
|
/**
|
|
220
218
|
* Remove from the selection in the currently shown workbook map view.
|
|
221
219
|
*
|
|
222
|
-
* @hidden
|
|
223
220
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
224
221
|
* @param {unknown[][]} values - The IDs of the objects to unselect
|
|
225
222
|
* @param {object} [__namedParameters]
|
|
@@ -241,12 +238,14 @@ export class CadenzaClient {
|
|
|
241
238
|
* @param {CommonEditGeometryOptions} [editGeometryOptions] - Options for the initialization of the geometry editor.
|
|
242
239
|
* @throws For invalid arguments
|
|
243
240
|
* @fires
|
|
241
|
+
* - {@link CadenzaChangeExtentEvent}
|
|
242
|
+
* - {@link CadenzaChangeSelectionEvent}
|
|
244
243
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
245
244
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
246
245
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
247
246
|
* @embed
|
|
248
247
|
*/
|
|
249
|
-
createGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, useMapSrs, operationMode, signal, snapping, }?: CommonEditGeometryOptions | undefined, ...args: any[]): Promise<void>;
|
|
248
|
+
createGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, useMapSrs, operationMode, signal, snapping, hideLegend, }?: CommonEditGeometryOptions | undefined, ...args: any[]): Promise<void>;
|
|
250
249
|
/**
|
|
251
250
|
* Edit a geometry.
|
|
252
251
|
*
|
|
@@ -256,12 +255,14 @@ export class CadenzaClient {
|
|
|
256
255
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
257
256
|
* @throws For invalid arguments
|
|
258
257
|
* @fires
|
|
258
|
+
* - {@link CadenzaChangeExtentEvent}
|
|
259
|
+
* - {@link CadenzaChangeSelectionEvent}
|
|
259
260
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
260
261
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
261
262
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
262
263
|
* @embed
|
|
263
264
|
*/
|
|
264
|
-
editGeometry(backgroundMapView: EmbeddingTargetId, geometry: Geometry, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, }?: CommonEditGeometryOptions | undefined, ...args: any[]): Promise<void>;
|
|
265
|
+
editGeometry(backgroundMapView: EmbeddingTargetId, geometry: Geometry, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, hideLegend, }?: CommonEditGeometryOptions | undefined, ...args: any[]): Promise<void>;
|
|
265
266
|
/**
|
|
266
267
|
* Create multiple geometries.
|
|
267
268
|
*
|
|
@@ -271,6 +272,8 @@ export class CadenzaClient {
|
|
|
271
272
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
272
273
|
* @throws For invalid arguments
|
|
273
274
|
* @fires
|
|
275
|
+
* - {@link CadenzaChangeExtentEvent}
|
|
276
|
+
* - {@link CadenzaChangeSelectionEvent}
|
|
274
277
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
275
278
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
276
279
|
* - {@link CadenzaEditGeometryCreateEvent}
|
|
@@ -279,7 +282,7 @@ export class CadenzaClient {
|
|
|
279
282
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
280
283
|
* @embed
|
|
281
284
|
*/
|
|
282
|
-
batchCreateGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, }?: CommonEditGeometryOptions | undefined, ...args: any[]): Promise<void>;
|
|
285
|
+
batchCreateGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, hideLegend, }?: CommonEditGeometryOptions | undefined, ...args: any[]): Promise<void>;
|
|
283
286
|
/**
|
|
284
287
|
* Edit multiple geometries.
|
|
285
288
|
*
|
|
@@ -289,6 +292,8 @@ export class CadenzaClient {
|
|
|
289
292
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
290
293
|
* @throws For invalid arguments
|
|
291
294
|
* @fires
|
|
295
|
+
* - {@link CadenzaChangeExtentEvent}
|
|
296
|
+
* - {@link CadenzaChangeSelectionEvent}
|
|
292
297
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
293
298
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
294
299
|
* - {@link CadenzaEditGeometryCreateEvent}
|
|
@@ -297,13 +302,18 @@ export class CadenzaClient {
|
|
|
297
302
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
298
303
|
* @embed
|
|
299
304
|
*/
|
|
300
|
-
batchEditGeometry(backgroundMapView: EmbeddingTargetId, features: FeatureCollection, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, }?: CommonEditGeometryOptions | undefined, ...args: any[]): Promise<void>;
|
|
305
|
+
batchEditGeometry(backgroundMapView: EmbeddingTargetId, features: FeatureCollection, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, hideLegend, }?: CommonEditGeometryOptions | undefined, ...args: any[]): Promise<void>;
|
|
301
306
|
/**
|
|
302
|
-
* Set custom
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
+
* Set the custom validation status of the geometry editor dialog ( {@link createGeometry}, {@link editGeometry}, {@link batchCreateGeometry}, {@link batchEditGeometry} )
|
|
308
|
+
* or the {@link selectObjects} dialog in addition to the default validation status (including errors and warnings).
|
|
309
|
+
*
|
|
310
|
+
* Behavior:
|
|
311
|
+
* - When the custom validation status is of type 'error', the dialog submission is blocked.
|
|
312
|
+
* - If a custom validation status is already set, it will be overwritten.
|
|
313
|
+
* - Passing '' (an empty string) as the message parameter resets the custom validation status, which means no custom validation status is displayed.
|
|
314
|
+
*
|
|
315
|
+
* If neither the geometry editor nor {@link selectObjects} is started, the method call has no effect.
|
|
316
|
+
*
|
|
307
317
|
* @param {string} message The message to show in the dialog
|
|
308
318
|
* @param {CustomValidityType} [type] The type of message (defaults to 'error')
|
|
309
319
|
*/
|
|
@@ -444,6 +454,7 @@ export class CadenzaClient {
|
|
|
444
454
|
}
|
|
445
455
|
/**
|
|
446
456
|
* @typedef {'action'
|
|
457
|
+
* | 'change:extent'
|
|
447
458
|
* | 'change:selection'
|
|
448
459
|
* | 'drillThrough'
|
|
449
460
|
* | 'editGeometry:ok'
|
|
@@ -460,6 +471,7 @@ export class CadenzaClient {
|
|
|
460
471
|
/**
|
|
461
472
|
* @template {CadenzaEventType} T
|
|
462
473
|
* @typedef {T extends 'action' ? CadenzaActionEvent
|
|
474
|
+
* : T extends 'change:extent' ? CadenzaChangeExtentEvent
|
|
463
475
|
* : T extends 'change:selection' ? CadenzaChangeSelectionEvent
|
|
464
476
|
* : T extends 'drillThrough' ? CadenzaDrillThroughEvent
|
|
465
477
|
* : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent
|
|
@@ -484,6 +496,10 @@ export class CadenzaClient {
|
|
|
484
496
|
/**
|
|
485
497
|
* @typedef {CadenzaEvent<'action', {context: string}>} CadenzaActionEvent - When the user executed a POST message action, which is defined on an external link in the Cadenza management center.
|
|
486
498
|
*/
|
|
499
|
+
/**
|
|
500
|
+
* @typedef {CadenzaEvent<'change:extent', {extent: Extent}>} CadenzaChangeExtentEvent - When the user moved the map.
|
|
501
|
+
* The extent is transformed according to the `useMapSrs` option.
|
|
502
|
+
*/
|
|
487
503
|
/**
|
|
488
504
|
* @typedef {CadenzaEvent<'change:selection', undefined | {layer: WorkbookLayerPath, values: unknown[][]}>} CadenzaChangeSelectionEvent - When the user changed the selection. `undefined` if no objects were selected.
|
|
489
505
|
*
|
|
@@ -784,6 +800,10 @@ export type CommonEditGeometryOptions = {
|
|
|
784
800
|
* - Passing these options enables snapping
|
|
785
801
|
*/
|
|
786
802
|
snapping?: SnappingOptions | undefined;
|
|
803
|
+
/**
|
|
804
|
+
* - Whether the legend should be hidden initially. Default is true.
|
|
805
|
+
*/
|
|
806
|
+
hideLegend?: boolean | undefined;
|
|
787
807
|
/**
|
|
788
808
|
* - Whether the coordinates specified in other parameters are specified in the map's SRS and the created geometry should use the map's SRS (otherwise EPSG:4326 is assumed)
|
|
789
809
|
*/
|
|
@@ -934,8 +954,8 @@ export type Layout = 'dashboard' | 'linear';
|
|
|
934
954
|
/**
|
|
935
955
|
* - An event type to subscribe to using {@link CadenzaClienton }
|
|
936
956
|
*/
|
|
937
|
-
export type CadenzaEventType = 'action' | 'change:selection' | 'drillThrough' | 'editGeometry:ok' | 'editGeometry:create' | 'editGeometry:edit' | 'editGeometry:delete' | 'editGeometry:update' | 'editGeometry:cancel' | 'reload' | 'selectObjects:ok' | 'selectObjects:cancel';
|
|
938
|
-
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:create' ? CadenzaEditGeometryCreateEvent : T extends 'editGeometry:edit' ? CadenzaEditGeometryEditEvent : T extends 'editGeometry:delete' ? CadenzaEditGeometryDeleteEvent : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent : T extends 'reload' ? CadenzaReloadEvent : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent : never;
|
|
957
|
+
export type CadenzaEventType = 'action' | 'change:extent' | 'change:selection' | 'drillThrough' | 'editGeometry:ok' | 'editGeometry:create' | 'editGeometry:edit' | 'editGeometry:delete' | 'editGeometry:update' | 'editGeometry:cancel' | 'reload' | 'selectObjects:ok' | 'selectObjects:cancel';
|
|
958
|
+
export type CadenzaEventByType<T extends CadenzaEventType> = T extends 'action' ? CadenzaActionEvent : T extends 'change:extent' ? CadenzaChangeExtentEvent : T extends 'change:selection' ? CadenzaChangeSelectionEvent : T extends 'drillThrough' ? CadenzaDrillThroughEvent : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent : T extends 'editGeometry:create' ? CadenzaEditGeometryCreateEvent : T extends 'editGeometry:edit' ? CadenzaEditGeometryEditEvent : T extends 'editGeometry:delete' ? CadenzaEditGeometryDeleteEvent : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent : T extends 'reload' ? CadenzaReloadEvent : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent : never;
|
|
939
959
|
/**
|
|
940
960
|
* - A Cadenza `postMessage()` event
|
|
941
961
|
*/
|
|
@@ -955,6 +975,13 @@ export type CadenzaEvent<TYPE extends string, DETAIL = unknown> = {
|
|
|
955
975
|
export type CadenzaActionEvent = CadenzaEvent<'action', {
|
|
956
976
|
context: string;
|
|
957
977
|
}>;
|
|
978
|
+
/**
|
|
979
|
+
* - When the user moved the map.
|
|
980
|
+
* The extent is transformed according to the `useMapSrs` option.
|
|
981
|
+
*/
|
|
982
|
+
export type CadenzaChangeExtentEvent = CadenzaEvent<'change:extent', {
|
|
983
|
+
extent: [number, number, number, number];
|
|
984
|
+
}>;
|
|
958
985
|
/**
|
|
959
986
|
* - When the user changed the selection. `undefined` if no objects were selected.
|
|
960
987
|
*
|
package/cadenza.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
// This placeholder is replaced when Cadenza JS is released,
|
|
20
20
|
// i.e. during development, the version is not available.
|
|
21
|
-
const CADENZAJS_VERSION = '10.
|
|
21
|
+
const CADENZAJS_VERSION = '10.6.0';
|
|
22
22
|
/**
|
|
23
23
|
* Creates an instance of the Cadenza JS client.
|
|
24
24
|
*
|
|
@@ -177,6 +177,7 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
|
|
|
177
177
|
* @property {OperationMode} [operationMode] - The mode in which a workbook should be operated
|
|
178
178
|
* @property {AbortSignal} [signal] - A signal to abort the iframe loading
|
|
179
179
|
* @property {SnappingOptions} [snapping] - Passing these options enables snapping
|
|
180
|
+
* @property {boolean} [hideLegend] - Whether the legend should be hidden initially. Default is true.
|
|
180
181
|
* @property {boolean} [useMapSrs] - Whether the coordinates specified in other parameters are specified in the map's SRS and the created geometry should use the map's SRS (otherwise EPSG:4326 is assumed)
|
|
181
182
|
*/
|
|
182
183
|
/**
|
|
@@ -427,6 +428,8 @@ export class CadenzaClient {
|
|
|
427
428
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
428
429
|
* @throws For invalid arguments
|
|
429
430
|
* @fires
|
|
431
|
+
* - {@link CadenzaChangeExtentEvent}
|
|
432
|
+
* - {@link CadenzaChangeSelectionEvent}
|
|
430
433
|
* - {@link CadenzaDrillThroughEvent}
|
|
431
434
|
* - {@link CadenzaActionEvent}
|
|
432
435
|
* @embed
|
|
@@ -497,7 +500,6 @@ export class CadenzaClient {
|
|
|
497
500
|
/**
|
|
498
501
|
* Set filter variables in the currently shown workbook.
|
|
499
502
|
*
|
|
500
|
-
* @hidden
|
|
501
503
|
* @param {FilterVariables} filter - The variable values
|
|
502
504
|
* @return {Promise<void>} A `Promise` for when the filter variables were set.
|
|
503
505
|
* @postMessage
|
|
@@ -513,7 +515,6 @@ export class CadenzaClient {
|
|
|
513
515
|
* When making a layer visible, its ancestors will be made visible, too.
|
|
514
516
|
* When hiding a layer, the ancestors are not affected.
|
|
515
517
|
*
|
|
516
|
-
* @hidden
|
|
517
518
|
* @param {WorkbookLayerPath | string} layer - The layer to show or hide
|
|
518
519
|
* (identified using a layer path or a print name)
|
|
519
520
|
* @param {boolean} visible - The visibility state of the layer
|
|
@@ -530,7 +531,6 @@ export class CadenzaClient {
|
|
|
530
531
|
/**
|
|
531
532
|
* Set the selection in the currently shown workbook map view.
|
|
532
533
|
*
|
|
533
|
-
* @hidden
|
|
534
534
|
* @param {WorkbookLayerPath | string} layer - The data view layer to set the selection in
|
|
535
535
|
* @param {unknown[][]} values - The IDs of the objects to select
|
|
536
536
|
* @param {object} [__namedParameters]
|
|
@@ -550,7 +550,6 @@ export class CadenzaClient {
|
|
|
550
550
|
/**
|
|
551
551
|
* Add to the selection in the currently shown workbook map view.
|
|
552
552
|
*
|
|
553
|
-
* @hidden
|
|
554
553
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
555
554
|
* @param {unknown[][]} values - The IDs of the objects to select
|
|
556
555
|
* @param {object} [__namedParameters]
|
|
@@ -570,7 +569,6 @@ export class CadenzaClient {
|
|
|
570
569
|
/**
|
|
571
570
|
* Remove from the selection in the currently shown workbook map view.
|
|
572
571
|
*
|
|
573
|
-
* @hidden
|
|
574
572
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
575
573
|
* @param {unknown[][]} values - The IDs of the objects to unselect
|
|
576
574
|
* @param {object} [__namedParameters]
|
|
@@ -598,12 +596,14 @@ export class CadenzaClient {
|
|
|
598
596
|
* @param {CommonEditGeometryOptions} [editGeometryOptions] - Options for the initialization of the geometry editor.
|
|
599
597
|
* @throws For invalid arguments
|
|
600
598
|
* @fires
|
|
599
|
+
* - {@link CadenzaChangeExtentEvent}
|
|
600
|
+
* - {@link CadenzaChangeSelectionEvent}
|
|
601
601
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
602
602
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
603
603
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
604
604
|
* @embed
|
|
605
605
|
*/
|
|
606
|
-
async createGeometry(backgroundMapView, geometryType, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, useMapSrs, operationMode, signal, snapping, } = {}) {
|
|
606
|
+
async createGeometry(backgroundMapView, geometryType, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, useMapSrs, operationMode, signal, snapping, hideLegend = true, } = {}) {
|
|
607
607
|
this.#log('CadenzaClient#createGeometry', ...arguments);
|
|
608
608
|
const validExtentStrategy = sanitizeExtentStrategy({
|
|
609
609
|
extentStrategy,
|
|
@@ -613,6 +613,7 @@ export class CadenzaClient {
|
|
|
613
613
|
disabledUiFeatures,
|
|
614
614
|
filter,
|
|
615
615
|
geometryType,
|
|
616
|
+
hideLegend,
|
|
616
617
|
minScale,
|
|
617
618
|
operationMode,
|
|
618
619
|
snapping,
|
|
@@ -635,12 +636,14 @@ export class CadenzaClient {
|
|
|
635
636
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
636
637
|
* @throws For invalid arguments
|
|
637
638
|
* @fires
|
|
639
|
+
* - {@link CadenzaChangeExtentEvent}
|
|
640
|
+
* - {@link CadenzaChangeSelectionEvent}
|
|
638
641
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
639
642
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
640
643
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
641
644
|
* @embed
|
|
642
645
|
*/
|
|
643
|
-
async editGeometry(backgroundMapView, geometry, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, } = {}) {
|
|
646
|
+
async editGeometry(backgroundMapView, geometry, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, hideLegend = true, } = {}) {
|
|
644
647
|
this.#log('CadenzaClient#editGeometry', ...arguments);
|
|
645
648
|
const geometryType = geometry.type;
|
|
646
649
|
assertValidGeometryType(geometryType);
|
|
@@ -653,6 +656,7 @@ export class CadenzaClient {
|
|
|
653
656
|
disabledUiFeatures,
|
|
654
657
|
filter,
|
|
655
658
|
geometryType,
|
|
659
|
+
hideLegend,
|
|
656
660
|
minScale,
|
|
657
661
|
operationMode,
|
|
658
662
|
snapping,
|
|
@@ -676,6 +680,8 @@ export class CadenzaClient {
|
|
|
676
680
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
677
681
|
* @throws For invalid arguments
|
|
678
682
|
* @fires
|
|
683
|
+
* - {@link CadenzaChangeExtentEvent}
|
|
684
|
+
* - {@link CadenzaChangeSelectionEvent}
|
|
679
685
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
680
686
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
681
687
|
* - {@link CadenzaEditGeometryCreateEvent}
|
|
@@ -684,7 +690,7 @@ export class CadenzaClient {
|
|
|
684
690
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
685
691
|
* @embed
|
|
686
692
|
*/
|
|
687
|
-
async batchCreateGeometry(backgroundMapView, geometryType, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, } = {}) {
|
|
693
|
+
async batchCreateGeometry(backgroundMapView, geometryType, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, hideLegend = true, } = {}) {
|
|
688
694
|
this.#log('CadenzaClient#editGeometry', ...arguments);
|
|
689
695
|
assertValidGeometryType(geometryType);
|
|
690
696
|
const validExtentStrategy = sanitizeExtentStrategy({
|
|
@@ -696,6 +702,7 @@ export class CadenzaClient {
|
|
|
696
702
|
disabledUiFeatures,
|
|
697
703
|
filter,
|
|
698
704
|
geometryType,
|
|
705
|
+
hideLegend,
|
|
699
706
|
minScale,
|
|
700
707
|
operationMode,
|
|
701
708
|
snapping,
|
|
@@ -718,6 +725,8 @@ export class CadenzaClient {
|
|
|
718
725
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
719
726
|
* @throws For invalid arguments
|
|
720
727
|
* @fires
|
|
728
|
+
* - {@link CadenzaChangeExtentEvent}
|
|
729
|
+
* - {@link CadenzaChangeSelectionEvent}
|
|
721
730
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
722
731
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
723
732
|
* - {@link CadenzaEditGeometryCreateEvent}
|
|
@@ -726,7 +735,7 @@ export class CadenzaClient {
|
|
|
726
735
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
727
736
|
* @embed
|
|
728
737
|
*/
|
|
729
|
-
async batchEditGeometry(backgroundMapView, features, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, } = {}) {
|
|
738
|
+
async batchEditGeometry(backgroundMapView, features, { additionalLayers, disabledUiFeatures, extentStrategy, filter, minScale, operationMode, signal, snapping, useMapSrs, hideLegend = true, } = {}) {
|
|
730
739
|
this.#log('CadenzaClient#editGeometry', ...arguments);
|
|
731
740
|
const geometryType = getGeometryTypeFromFeatureCollection(features);
|
|
732
741
|
const validExtentStrategy = sanitizeExtentStrategy({
|
|
@@ -739,6 +748,7 @@ export class CadenzaClient {
|
|
|
739
748
|
disabledUiFeatures,
|
|
740
749
|
filter,
|
|
741
750
|
geometryType,
|
|
751
|
+
hideLegend,
|
|
742
752
|
minScale,
|
|
743
753
|
operationMode,
|
|
744
754
|
snapping,
|
|
@@ -749,8 +759,8 @@ export class CadenzaClient {
|
|
|
749
759
|
await this.#setupEditorViaPostRequests({
|
|
750
760
|
additionalLayers,
|
|
751
761
|
validExtentStrategy,
|
|
752
|
-
features,
|
|
753
762
|
});
|
|
763
|
+
await this.#createFeaturesAndEditLastCreatedFeature(features);
|
|
754
764
|
await this.#setEditorStateToReady();
|
|
755
765
|
}
|
|
756
766
|
/**
|
|
@@ -758,10 +768,9 @@ export class CadenzaClient {
|
|
|
758
768
|
* @param [__namedParameters.geometry] {Geometry} - The geometry to edit
|
|
759
769
|
* @param [__namedParameters.additionalLayers] {LayerDefinition[]} - Layer definitions to be imported and shown in the background, as a basis for the drawing. IMPORTANT: The Cadenza referenced with `cadenzaClient` must be configured to support the import of GeoJSON, and the (system) privileges of the corresponding user must also be set in such a way that the import of GeoJSON is possible.
|
|
760
770
|
* @param [__namedParameters.validExtentStrategy] {ExtentStrategy} - Defines the initial map extent; If not given, Cadenza's default logic is used.
|
|
761
|
-
* @param [__namedParameters.features] {FeatureCollection} - The features to edit. The last feature in this collection is directly set up for editing.
|
|
762
771
|
* @returns {Promise<Awaited<unknown>[]>}
|
|
763
772
|
*/
|
|
764
|
-
#setupEditorViaPostRequests({ geometry, additionalLayers, validExtentStrategy,
|
|
773
|
+
#setupEditorViaPostRequests({ geometry, additionalLayers, validExtentStrategy, }) {
|
|
765
774
|
const postRequests = [];
|
|
766
775
|
postRequests.push(this.#setExtentStrategy(validExtentStrategy));
|
|
767
776
|
if (geometry) {
|
|
@@ -774,20 +783,58 @@ export class CadenzaClient {
|
|
|
774
783
|
postRequests.push(this.#postRequest('importLayer', layer));
|
|
775
784
|
}
|
|
776
785
|
}
|
|
777
|
-
if (features) {
|
|
778
|
-
postRequests.push(this.#postRequest('addFeatures', features));
|
|
779
|
-
}
|
|
780
786
|
return Promise.all(postRequests);
|
|
781
787
|
}
|
|
788
|
+
/**
|
|
789
|
+
* @param {FeatureCollection} features - The features to edit.
|
|
790
|
+
*/
|
|
791
|
+
async #createFeaturesAndEditLastCreatedFeature(features) {
|
|
792
|
+
const editFeaturePromise = new Promise((resolve) => {
|
|
793
|
+
this.#once('editGeometry:create',
|
|
794
|
+
/** @param {CadenzaEditGeometryCreateEvent} event */ async (event) => {
|
|
795
|
+
const featureOrCollection = event.detail;
|
|
796
|
+
let lastAddedFeature;
|
|
797
|
+
if (featureOrCollection.type === 'Feature') {
|
|
798
|
+
lastAddedFeature = featureOrCollection;
|
|
799
|
+
}
|
|
800
|
+
else {
|
|
801
|
+
const addedFeatures = featureOrCollection.features;
|
|
802
|
+
lastAddedFeature = addedFeatures[addedFeatures.length - 1];
|
|
803
|
+
}
|
|
804
|
+
await this.#setEditFeature(lastAddedFeature.objectId);
|
|
805
|
+
resolve(undefined);
|
|
806
|
+
});
|
|
807
|
+
});
|
|
808
|
+
await this.#postRequest('createFeatures', features);
|
|
809
|
+
return editFeaturePromise;
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Send a request to the geometry editor to edit the feature with the given ID.
|
|
813
|
+
* If another feature is currently being edited or created,
|
|
814
|
+
* the user is prompted to save (if possible), discard the current changes, or to abort the request.
|
|
815
|
+
*
|
|
816
|
+
* @param {any[]} objectId - The id of the feature
|
|
817
|
+
*/
|
|
818
|
+
#setEditFeature(objectId) {
|
|
819
|
+
return this.#postRequest('requestEditFeature', objectId);
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Sets editor state to ready.
|
|
823
|
+
*/
|
|
782
824
|
#setEditorStateToReady() {
|
|
783
825
|
return this.#postRequest('setEditorState', 'READY');
|
|
784
826
|
}
|
|
785
827
|
/**
|
|
786
|
-
* Set custom
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
*
|
|
790
|
-
*
|
|
828
|
+
* Set the custom validation status of the geometry editor dialog ( {@link createGeometry}, {@link editGeometry}, {@link batchCreateGeometry}, {@link batchEditGeometry} )
|
|
829
|
+
* or the {@link selectObjects} dialog in addition to the default validation status (including errors and warnings).
|
|
830
|
+
*
|
|
831
|
+
* Behavior:
|
|
832
|
+
* - When the custom validation status is of type 'error', the dialog submission is blocked.
|
|
833
|
+
* - If a custom validation status is already set, it will be overwritten.
|
|
834
|
+
* - Passing '' (an empty string) as the message parameter resets the custom validation status, which means no custom validation status is displayed.
|
|
835
|
+
*
|
|
836
|
+
* If neither the geometry editor nor {@link selectObjects} is started, the method call has no effect.
|
|
837
|
+
*
|
|
791
838
|
* @param {string} message The message to show in the dialog
|
|
792
839
|
* @param {CustomValidityType} [type] The type of message (defaults to 'error')
|
|
793
840
|
*/
|
|
@@ -953,6 +1000,20 @@ export class CadenzaClient {
|
|
|
953
1000
|
}
|
|
954
1001
|
};
|
|
955
1002
|
}
|
|
1003
|
+
/**
|
|
1004
|
+
* @template {CadenzaEventType | string} TYPE
|
|
1005
|
+
* @template [DETAIL=unknown]
|
|
1006
|
+
* @param {TYPE} type
|
|
1007
|
+
* @param {(event: CadenzaEvent<TYPE, DETAIL>) => void} subscriber
|
|
1008
|
+
* @return {() => void} An unsubscribe function
|
|
1009
|
+
*/
|
|
1010
|
+
#once(type, subscriber) {
|
|
1011
|
+
const unsubscribe = this.#on(type, (event) => {
|
|
1012
|
+
subscriber(/** @type {CadenzaEvent<TYPE, DETAIL>} */ (event));
|
|
1013
|
+
unsubscribe();
|
|
1014
|
+
});
|
|
1015
|
+
return unsubscribe;
|
|
1016
|
+
}
|
|
956
1017
|
// Use arrow function so that it's bound to this.
|
|
957
1018
|
#onMessage = (
|
|
958
1019
|
/** @type MessageEvent<CadenzaEvent<never, never>> */ event) => {
|
|
@@ -1185,6 +1246,7 @@ export class CadenzaClient {
|
|
|
1185
1246
|
* @param {string} [params.fileName]
|
|
1186
1247
|
* @param {FilterVariables} [params.filter]
|
|
1187
1248
|
* @param {GeometryType} [params.geometryType]
|
|
1249
|
+
* @param {boolean} [params.hideLegend]
|
|
1188
1250
|
* @param {boolean} [params.hideMainHeaderAndFooter]
|
|
1189
1251
|
* @param {boolean} [params.hideWorkbookToolBar]
|
|
1190
1252
|
* @param {GlobalId} [params.highlightGlobalId]
|
|
@@ -1201,7 +1263,7 @@ export class CadenzaClient {
|
|
|
1201
1263
|
* @param {Layout} [params.layout]
|
|
1202
1264
|
* @return {URLSearchParams}
|
|
1203
1265
|
*/
|
|
1204
|
-
#createParams({ action, batchModeEnabled, dataType, disabledUiFeatures, expandNavigator, fileName, filter, geometryType, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, layers, minScale, operationMode, worksheetPlaceholders, parts, targetType, snapping, useMapSrs, validExtentStrategy, layout, }) {
|
|
1266
|
+
#createParams({ action, batchModeEnabled, dataType, disabledUiFeatures, expandNavigator, fileName, filter, geometryType, hideLegend, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, layers, minScale, operationMode, worksheetPlaceholders, parts, targetType, snapping, useMapSrs, validExtentStrategy, layout, }) {
|
|
1205
1267
|
if (disabledUiFeatures) {
|
|
1206
1268
|
disabledUiFeatures.forEach((feature) => assert(validUiFeature(feature), `Invalid UI feature: ${feature}`));
|
|
1207
1269
|
}
|
|
@@ -1253,6 +1315,7 @@ export class CadenzaClient {
|
|
|
1253
1315
|
JSON.stringify(worksheetPrintName),
|
|
1254
1316
|
]))),
|
|
1255
1317
|
...(geometryType && { geometryType }),
|
|
1318
|
+
...(hideLegend && { hideLegend: 'true' }),
|
|
1256
1319
|
...(hideMainHeaderAndFooter && { hideMainHeaderAndFooter: 'true' }),
|
|
1257
1320
|
...(hideWorkbookToolBar && { hideWorkbookToolBar: 'true' }),
|
|
1258
1321
|
...(highlightGlobalId && { highlightGlobalId }),
|
|
@@ -1467,6 +1530,7 @@ function getGeometryTypeFromFeatureCollection(featureCollection) {
|
|
|
1467
1530
|
// Please do not add internal event types like 'ready' here.
|
|
1468
1531
|
/**
|
|
1469
1532
|
* @typedef {'action'
|
|
1533
|
+
* | 'change:extent'
|
|
1470
1534
|
* | 'change:selection'
|
|
1471
1535
|
* | 'drillThrough'
|
|
1472
1536
|
* | 'editGeometry:ok'
|
|
@@ -1483,6 +1547,7 @@ function getGeometryTypeFromFeatureCollection(featureCollection) {
|
|
|
1483
1547
|
/**
|
|
1484
1548
|
* @template {CadenzaEventType} T
|
|
1485
1549
|
* @typedef {T extends 'action' ? CadenzaActionEvent
|
|
1550
|
+
* : T extends 'change:extent' ? CadenzaChangeExtentEvent
|
|
1486
1551
|
* : T extends 'change:selection' ? CadenzaChangeSelectionEvent
|
|
1487
1552
|
* : T extends 'drillThrough' ? CadenzaDrillThroughEvent
|
|
1488
1553
|
* : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent
|
|
@@ -1507,8 +1572,7 @@ function getGeometryTypeFromFeatureCollection(featureCollection) {
|
|
|
1507
1572
|
/**
|
|
1508
1573
|
* @typedef {CadenzaEvent<'action', {context: string}>} CadenzaActionEvent - When the user executed a POST message action, which is defined on an external link in the Cadenza management center.
|
|
1509
1574
|
*/
|
|
1510
|
-
|
|
1511
|
-
* @hidden
|
|
1575
|
+
/**
|
|
1512
1576
|
* @typedef {CadenzaEvent<'change:extent', {extent: Extent}>} CadenzaChangeExtentEvent - When the user moved the map.
|
|
1513
1577
|
* The extent is transformed according to the `useMapSrs` option.
|
|
1514
1578
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@disy/cadenza.js",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": "github:DisyInformationssysteme/cadenza.js",
|
|
6
6
|
"type": "module",
|
|
@@ -18,21 +18,19 @@
|
|
|
18
18
|
"build": "run-p validate:* build:*",
|
|
19
19
|
"build:docs": "typedoc",
|
|
20
20
|
"build:ts": "tsc",
|
|
21
|
-
"validate:format": "prettier ./src --check",
|
|
21
|
+
"validate:format": "prettier ./src/**/*.{js,ts} --check",
|
|
22
22
|
"validate:changelog": "changelog --latest-release",
|
|
23
23
|
"start": "run-p start:*",
|
|
24
24
|
"start:docs": "npm run build:docs -- --watch",
|
|
25
25
|
"start:test": "npm test -- --watch",
|
|
26
26
|
"start:ts": "npm run build:ts -- --watch",
|
|
27
|
-
"start:reformat": "onchange \"src
|
|
27
|
+
"start:reformat": "onchange \"src/**/*.js\" \"src/**/*.ts\" -- prettier {{changed}} --write",
|
|
28
28
|
"test": "cross-env NODE_OPTIONS=--unhandled-rejections=warn jest",
|
|
29
|
-
"deploy:docs": "gh-pages --dist apidoc",
|
|
30
29
|
"sandbox": "node ./sandbox.cjs"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
32
|
"@types/jest": "29.5.14",
|
|
34
33
|
"cross-env": "7.0.3",
|
|
35
|
-
"gh-pages": "6.3.0",
|
|
36
34
|
"http-server": "14.1.1",
|
|
37
35
|
"jest": "29.7.0",
|
|
38
36
|
"jest-environment-jsdom": "29.7.0",
|