@disy/cadenza.js 2.8.1 → 2.8.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 +4 -0
- package/apidoc/assets/navigation.js +1 -1
- package/apidoc/assets/search.js +1 -1
- package/apidoc/classes/AbortError.html +2 -2
- package/apidoc/classes/CadenzaClient.html +29 -20
- package/apidoc/classes/CadenzaError.html +3 -3
- package/apidoc/functions/cadenza.html +2 -2
- package/apidoc/index.html +5 -1
- package/apidoc/interfaces/CadenzaClientOptions.html +5 -5
- package/apidoc/interfaces/CadenzaEvent.html +3 -3
- package/apidoc/interfaces/ExternalLinkKey.html +3 -3
- package/apidoc/interfaces/Feature.html +12 -0
- package/apidoc/interfaces/FeatureCollection.html +4 -0
- package/apidoc/interfaces/Geometry.html +2 -2
- package/apidoc/interfaces/PageSource.html +2 -2
- package/apidoc/modules.html +2 -0
- package/apidoc/types/CadenzaChangeSelectionEvent.html +1 -1
- package/apidoc/types/CadenzaDrillThroughEvent.html +1 -1
- package/apidoc/types/CadenzaEditGeometryCancelEvent.html +1 -1
- package/apidoc/types/CadenzaEditGeometryOkEvent.html +1 -1
- package/apidoc/types/CadenzaEditGeometryUpdateEvent.html +1 -1
- package/apidoc/types/CadenzaErrorEvent.html +1 -1
- package/apidoc/types/CadenzaEventByType.html +1 -1
- package/apidoc/types/CadenzaEventType.html +1 -1
- package/apidoc/types/CadenzaObjectInfoEvent.html +1 -1
- package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +1 -1
- package/apidoc/types/CadenzaSelectObjectsOkEvent.html +1 -1
- package/apidoc/types/DataType.html +1 -1
- package/apidoc/types/EmbeddingTargetId.html +1 -1
- package/apidoc/types/Extent.html +1 -1
- package/apidoc/types/FilterVariables.html +1 -1
- package/apidoc/types/GeometryType.html +1 -1
- package/apidoc/types/GlobalId.html +1 -1
- package/apidoc/types/OpaqueString.html +1 -1
- package/apidoc/types/OperationMode.html +1 -1
- package/apidoc/types/TablePart.html +1 -1
- package/apidoc/types/UiFeature.html +1 -1
- package/apidoc/types/WorkbookLayerPath.html +1 -1
- package/cadenza.d.ts +61 -6
- package/cadenza.js +56 -5
- package/package.json +1 -1
- package/sandbox.html +39 -12
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
<li><code>"workbook-design"</code> - The workbook designer</li>
|
|
5
5
|
<li><code>"workbook-view-management"</code> - Add/Edit/Remove workbook views (Is included in 'workbook-design'.)</li>
|
|
6
6
|
</ul>
|
|
7
|
-
</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/
|
|
7
|
+
</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/ded6b3d12e30793a03df29333dceb95a2229ae4d/src/cadenza.js#L104">src/cadenza.js:104</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><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-private" name="private"/><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>Private</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></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><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 class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>Cadenza JS</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><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,3 +1,3 @@
|
|
|
1
1
|
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WorkbookLayerPath | Cadenza JS</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" data-base=".."><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"><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</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"><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">Workbook<wbr/>Layer<wbr/>Path</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/ded6b3d12e30793a03df29333dceb95a2229ae4d/src/cadenza.js#L93">src/cadenza.js:93</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><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-private" name="private"/><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>Private</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></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><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 class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>Cadenza JS</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><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
|
@@ -148,28 +148,28 @@ export class CadenzaClient {
|
|
|
148
148
|
*
|
|
149
149
|
* @hidden
|
|
150
150
|
* @param {WorkbookLayerPath | string} layer - The data view layer to set the selection in
|
|
151
|
-
* @param {unknown[]} values - The IDs of the objects to select
|
|
151
|
+
* @param {unknown[][]} values - The IDs of the objects to select
|
|
152
152
|
* @return {Promise<void>} A `Promise` for when the selection was set.
|
|
153
153
|
*/
|
|
154
|
-
setSelection(layer: WorkbookLayerPath | string, values: unknown[], ...args: any[]): Promise<void>;
|
|
154
|
+
setSelection(layer: WorkbookLayerPath | string, values: unknown[][], ...args: any[]): Promise<void>;
|
|
155
155
|
/**
|
|
156
156
|
* Add to the selection in the currently shown workbook map view.
|
|
157
157
|
*
|
|
158
158
|
* @hidden
|
|
159
159
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
160
|
-
* @param {unknown[]} values - The IDs of the objects to select
|
|
160
|
+
* @param {unknown[][]} values - The IDs of the objects to select
|
|
161
161
|
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
162
162
|
*/
|
|
163
|
-
addSelection(layer: WorkbookLayerPath | string, values: unknown[], ...args: any[]): Promise<void>;
|
|
163
|
+
addSelection(layer: WorkbookLayerPath | string, values: unknown[][], ...args: any[]): Promise<void>;
|
|
164
164
|
/**
|
|
165
165
|
* Remove from the selection in the currently shown workbook map view.
|
|
166
166
|
*
|
|
167
167
|
* @hidden
|
|
168
168
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
169
|
-
* @param {unknown[]} values - The IDs of the objects to unselect
|
|
169
|
+
* @param {unknown[][]} values - The IDs of the objects to unselect
|
|
170
170
|
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
171
171
|
*/
|
|
172
|
-
removeSelection(layer: WorkbookLayerPath | string, values: unknown[], ...args: any[]): Promise<void>;
|
|
172
|
+
removeSelection(layer: WorkbookLayerPath | string, values: unknown[][], ...args: any[]): Promise<void>;
|
|
173
173
|
/**
|
|
174
174
|
* Create a geometry.
|
|
175
175
|
*
|
|
@@ -289,6 +289,27 @@ export class CadenzaClient {
|
|
|
289
289
|
parts?: TablePart[] | undefined;
|
|
290
290
|
signal?: AbortSignal | undefined;
|
|
291
291
|
} | undefined, ...args: any[]): Promise<Response>;
|
|
292
|
+
/**
|
|
293
|
+
* Fetch object info from a workbook map view.
|
|
294
|
+
*
|
|
295
|
+
* @param {EmbeddingTargetId} source - The workbook view to fetch object info from.
|
|
296
|
+
* @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
|
|
297
|
+
* (identified using layer paths or print names)
|
|
298
|
+
* @param {unknown[][]} objectIds - The IDs of the objects to select
|
|
299
|
+
* @param {object} [options] - Options
|
|
300
|
+
* @param {FilterVariables} [options.filter] - Filter variables
|
|
301
|
+
* @param {AbortSignal} [options.signal] - A signal to abort the data fetching
|
|
302
|
+
* @param {Boolean} [options.useMapSrs] - Use the map SRS instead of WGS84
|
|
303
|
+
* @param {Boolean} [options.fullGeometries] - Return non-simplified geometries
|
|
304
|
+
* @return {Promise<FeatureCollection>} A `Promise` for the fetch response
|
|
305
|
+
* @throws For invalid arguments
|
|
306
|
+
*/
|
|
307
|
+
fetchObjectInfo(source: EmbeddingTargetId, layerPath: (WorkbookLayerPath | string)[], objectIds: unknown[][], { filter, signal, useMapSrs, fullGeometries }?: {
|
|
308
|
+
filter?: FilterVariables | undefined;
|
|
309
|
+
signal?: AbortSignal | undefined;
|
|
310
|
+
useMapSrs?: boolean | undefined;
|
|
311
|
+
fullGeometries?: boolean | undefined;
|
|
312
|
+
} | undefined, ...args: any[]): Promise<FeatureCollection>;
|
|
292
313
|
/**
|
|
293
314
|
* Download data from a workbook view.
|
|
294
315
|
*
|
|
@@ -529,6 +550,40 @@ export type TablePart = 'columns' | 'values' | 'totals';
|
|
|
529
550
|
* for Long variables, the API is currently limited to the Double value range.
|
|
530
551
|
*/
|
|
531
552
|
export type FilterVariables = Record<string, string | string[] | number | Date | null>;
|
|
553
|
+
/**
|
|
554
|
+
* - A adapted [GeoJSON](https://geojson.org/) feature object.
|
|
555
|
+
*/
|
|
556
|
+
export type Feature = {
|
|
557
|
+
/**
|
|
558
|
+
* - The id of the feature
|
|
559
|
+
*/
|
|
560
|
+
objectId: any[];
|
|
561
|
+
/**
|
|
562
|
+
* - The geometry
|
|
563
|
+
*/
|
|
564
|
+
geometry: Geometry;
|
|
565
|
+
/**
|
|
566
|
+
* - The formated properties
|
|
567
|
+
*/
|
|
568
|
+
properties: Record<string, string>;
|
|
569
|
+
/**
|
|
570
|
+
* - The area of a `Polygon` feature
|
|
571
|
+
*/
|
|
572
|
+
area?: number | undefined;
|
|
573
|
+
/**
|
|
574
|
+
* - The area of a `LineString` feature
|
|
575
|
+
*/
|
|
576
|
+
length?: number | undefined;
|
|
577
|
+
};
|
|
578
|
+
/**
|
|
579
|
+
* - A adapted [GeoJSON](https://geojson.org/) feature collection object
|
|
580
|
+
*/
|
|
581
|
+
export type FeatureCollection = {
|
|
582
|
+
/**
|
|
583
|
+
* - The features within this collection
|
|
584
|
+
*/
|
|
585
|
+
features: Feature[];
|
|
586
|
+
};
|
|
532
587
|
/**
|
|
533
588
|
* - An event type to subscribe to using {@link CadenzaClienton }
|
|
534
589
|
*/
|
package/cadenza.js
CHANGED
|
@@ -120,6 +120,18 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
|
|
|
120
120
|
* _Note:_ Since numbers in JavaScript are Double values ([more info on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding)),
|
|
121
121
|
* for Long variables, the API is currently limited to the Double value range.
|
|
122
122
|
*/
|
|
123
|
+
/**
|
|
124
|
+
* @typedef Feature - A adapted [GeoJSON](https://geojson.org/) feature object.
|
|
125
|
+
* @property {any[]} objectId - The id of the feature
|
|
126
|
+
* @property {Geometry} geometry - The geometry
|
|
127
|
+
* @property {Record<string, string>} properties - The formated properties
|
|
128
|
+
* @property {number} [area] - The area of a `Polygon` feature
|
|
129
|
+
* @property {number} [length] - The area of a `LineString` feature
|
|
130
|
+
*/
|
|
131
|
+
/**
|
|
132
|
+
* @typedef FeatureCollection - A adapted [GeoJSON](https://geojson.org/) feature collection object
|
|
133
|
+
* @property {Feature[]} features - The features within this collection
|
|
134
|
+
*/
|
|
123
135
|
let hasCadenzaSession = false;
|
|
124
136
|
/** @type {Promise<void> | undefined} */
|
|
125
137
|
let firstEmbeddingTargetShown;
|
|
@@ -349,7 +361,7 @@ export class CadenzaClient {
|
|
|
349
361
|
*
|
|
350
362
|
* @hidden
|
|
351
363
|
* @param {WorkbookLayerPath | string} layer - The data view layer to set the selection in
|
|
352
|
-
* @param {unknown[]} values - The IDs of the objects to select
|
|
364
|
+
* @param {unknown[][]} values - The IDs of the objects to select
|
|
353
365
|
* @return {Promise<void>} A `Promise` for when the selection was set.
|
|
354
366
|
*/
|
|
355
367
|
setSelection(layer, values) {
|
|
@@ -361,7 +373,7 @@ export class CadenzaClient {
|
|
|
361
373
|
*
|
|
362
374
|
* @hidden
|
|
363
375
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
364
|
-
* @param {unknown[]} values - The IDs of the objects to select
|
|
376
|
+
* @param {unknown[][]} values - The IDs of the objects to select
|
|
365
377
|
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
366
378
|
*/
|
|
367
379
|
addSelection(layer, values) {
|
|
@@ -373,7 +385,7 @@ export class CadenzaClient {
|
|
|
373
385
|
*
|
|
374
386
|
* @hidden
|
|
375
387
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
376
|
-
* @param {unknown[]} values - The IDs of the objects to unselect
|
|
388
|
+
* @param {unknown[][]} values - The IDs of the objects to unselect
|
|
377
389
|
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
378
390
|
*/
|
|
379
391
|
removeSelection(layer, values) {
|
|
@@ -681,13 +693,52 @@ export class CadenzaClient {
|
|
|
681
693
|
const params = createParams({ dataType, filter, parts });
|
|
682
694
|
return this.#fetch(resolvePath(source), params, signal);
|
|
683
695
|
}
|
|
696
|
+
/**
|
|
697
|
+
* Fetch object info from a workbook map view.
|
|
698
|
+
*
|
|
699
|
+
* @param {EmbeddingTargetId} source - The workbook view to fetch object info from.
|
|
700
|
+
* @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
|
|
701
|
+
* (identified using layer paths or print names)
|
|
702
|
+
* @param {unknown[][]} objectIds - The IDs of the objects to select
|
|
703
|
+
* @param {object} [options] - Options
|
|
704
|
+
* @param {FilterVariables} [options.filter] - Filter variables
|
|
705
|
+
* @param {AbortSignal} [options.signal] - A signal to abort the data fetching
|
|
706
|
+
* @param {Boolean} [options.useMapSrs] - Use the map SRS instead of WGS84
|
|
707
|
+
* @param {Boolean} [options.fullGeometries] - Return non-simplified geometries
|
|
708
|
+
* @return {Promise<FeatureCollection>} A `Promise` for the fetch response
|
|
709
|
+
* @throws For invalid arguments
|
|
710
|
+
*/
|
|
711
|
+
fetchObjectInfo(source, layerPath, objectIds, { filter, signal, useMapSrs, fullGeometries } = {}) {
|
|
712
|
+
this.#log('CadenzaClient#fetchObjectInfo', ...arguments);
|
|
713
|
+
const params = createParams({
|
|
714
|
+
filter,
|
|
715
|
+
});
|
|
716
|
+
return this.#fetch(resolvePath(source) + '/objectinfo', params, signal, JSON.stringify({
|
|
717
|
+
objectIds,
|
|
718
|
+
layerPath: array(layerPath),
|
|
719
|
+
useMapSrs,
|
|
720
|
+
fullGeometries,
|
|
721
|
+
})).then((response) => response.json());
|
|
722
|
+
}
|
|
684
723
|
async #fetch(
|
|
685
724
|
/** @type string */ path,
|
|
686
725
|
/** @type URLSearchParams */ params,
|
|
687
|
-
/** @type AbortSignal | undefined */ signal
|
|
726
|
+
/** @type AbortSignal | undefined */ signal,
|
|
727
|
+
/** @type String | undefined If body is set, the fetch will be a post.*/ body) {
|
|
688
728
|
const url = this.#createUrl(path, params);
|
|
689
729
|
this.#log('Fetch', url.toString());
|
|
690
|
-
const
|
|
730
|
+
const method = body ? 'POST' : undefined;
|
|
731
|
+
const headers = new Headers();
|
|
732
|
+
headers.set('X-Requested-With', 'XMLHttpRequest');
|
|
733
|
+
if (body) {
|
|
734
|
+
headers.set('Content-Type', 'application/json');
|
|
735
|
+
}
|
|
736
|
+
const res = await fetch(url, {
|
|
737
|
+
signal,
|
|
738
|
+
method,
|
|
739
|
+
headers,
|
|
740
|
+
body,
|
|
741
|
+
});
|
|
691
742
|
if (!res.ok) {
|
|
692
743
|
const errorType = {
|
|
693
744
|
400: 'bad-request',
|
package/package.json
CHANGED
package/sandbox.html
CHANGED
|
@@ -158,9 +158,9 @@
|
|
|
158
158
|
},
|
|
159
159
|
setFilter: data => cadenzaClient.setFilter(parseFilterVariables(data.filter)),
|
|
160
160
|
setLayerVisibility: data => cadenzaClient.setLayerVisibility(JSON.parse(data.layer), data.visibility === 'on'),
|
|
161
|
-
setSelection: data => cadenzaClient.setSelection(JSON.parse(data.layer), JSON.parse(data.
|
|
162
|
-
addSelection: data => cadenzaClient.addSelection(JSON.parse(data.layer), JSON.parse(data.
|
|
163
|
-
removeSelection: data => cadenzaClient.removeSelection(JSON.parse(data.layer), JSON.parse(data.
|
|
161
|
+
setSelection: data => cadenzaClient.setSelection(JSON.parse(data.layer), JSON.parse(data.objectIds)),
|
|
162
|
+
addSelection: data => cadenzaClient.addSelection(JSON.parse(data.layer), JSON.parse(data.objectIds)),
|
|
163
|
+
removeSelection: data => cadenzaClient.removeSelection(JSON.parse(data.layer), JSON.parse(data.objectIds)),
|
|
164
164
|
createGeometry: data => cadenzaClient.createGeometry(data.embeddingTargetId, data.geometryType, getOptions(data)),
|
|
165
165
|
editGeometry: ({ geometry, ...data }) => cadenzaClient.editGeometry(data.embeddingTargetId, JSON.parse(geometry), getOptions(data)),
|
|
166
166
|
selectObjects: data => cadenzaClient.selectObjects(data.embeddingTargetId, getOptions(data)),
|
|
@@ -168,6 +168,11 @@
|
|
|
168
168
|
console.log('Inspect the fetchData() request in the devtools.');
|
|
169
169
|
cadenzaClient.fetchData(data.embeddingTargetId, data.dataType, getOptions(data));
|
|
170
170
|
},
|
|
171
|
+
fetchObjectInfo: data => {
|
|
172
|
+
console.log('Inspect the fetchObjectInfo() request in the devtools.');
|
|
173
|
+
cadenzaClient.fetchObjectInfo(data.embeddingTargetId, JSON.parse(data.layer), JSON.parse(data.objectIds), getOptions(data))
|
|
174
|
+
.then(oi => console.log(oi));
|
|
175
|
+
},
|
|
171
176
|
downloadData: data => cadenzaClient.downloadData(data.embeddingTargetId, data.dataType, getOptions(data))
|
|
172
177
|
};
|
|
173
178
|
|
|
@@ -212,7 +217,8 @@
|
|
|
212
217
|
parts,
|
|
213
218
|
layers,
|
|
214
219
|
simplifiedOperationMode,
|
|
215
|
-
useMapSrs
|
|
220
|
+
useMapSrs,
|
|
221
|
+
fullGeometries
|
|
216
222
|
}) {
|
|
217
223
|
return {
|
|
218
224
|
disabledUiFeatures: disabledUiFeatures && disabledUiFeatures.split(','),
|
|
@@ -231,7 +237,8 @@
|
|
|
231
237
|
parts: parts && parts.split(','),
|
|
232
238
|
...(simplifiedOperationMode === 'on' && { operationMode: 'simplified' }),
|
|
233
239
|
layers: layers ? JSON.parse(layers) : undefined,
|
|
234
|
-
useMapSrs: useMapSrs === 'on'
|
|
240
|
+
useMapSrs: useMapSrs === 'on',
|
|
241
|
+
fullGeometries: fullGeometries === 'on'
|
|
235
242
|
};
|
|
236
243
|
}
|
|
237
244
|
|
|
@@ -280,6 +287,7 @@
|
|
|
280
287
|
<optgroup label="Without Iframe">
|
|
281
288
|
<option value="downloadData">Download data</option>
|
|
282
289
|
<option value="fetchData">Fetch data</option>
|
|
290
|
+
<option value="fetchObjectInfo">Fetch Object Info</option>
|
|
283
291
|
</optgroup>
|
|
284
292
|
</select>
|
|
285
293
|
</div>
|
|
@@ -513,9 +521,9 @@
|
|
|
513
521
|
</div>
|
|
514
522
|
</template>
|
|
515
523
|
|
|
516
|
-
<template data-action="setSelection" data-common="layer,
|
|
517
|
-
<template data-action="addSelection" data-common="layer,
|
|
518
|
-
<template data-action="removeSelection" data-common="layer,
|
|
524
|
+
<template data-action="setSelection" data-common="layer,object-ids"></template>
|
|
525
|
+
<template data-action="addSelection" data-common="layer,object-ids"></template>
|
|
526
|
+
<template data-action="removeSelection" data-common="layer,object-ids"></template>
|
|
519
527
|
|
|
520
528
|
<template data-action="reload">
|
|
521
529
|
<div>
|
|
@@ -527,12 +535,12 @@
|
|
|
527
535
|
</template>
|
|
528
536
|
<template data-action="closeMe">No Parameters needed.</template>
|
|
529
537
|
|
|
530
|
-
<template id="common-
|
|
538
|
+
<template id="common-object-ids">
|
|
531
539
|
<div>
|
|
532
|
-
<label for="
|
|
533
|
-
<textarea name="
|
|
540
|
+
<label for="objectids">List of object ID value lists *</label>
|
|
541
|
+
<textarea name="objectIds" id="objectids" rows="5" required></textarea>
|
|
534
542
|
<small>
|
|
535
|
-
<p>A JSON value like <code>["object1","object2"]</code></p>
|
|
543
|
+
<p>A JSON value like <code>[["<object1-id>"],["<object2-id>"]]</code></p>
|
|
536
544
|
</small>
|
|
537
545
|
</div>
|
|
538
546
|
</template>
|
|
@@ -568,6 +576,25 @@
|
|
|
568
576
|
</div>
|
|
569
577
|
</template>
|
|
570
578
|
|
|
579
|
+
<template data-action="fetchObjectInfo" data-common="layer,object-ids,filter">
|
|
580
|
+
<div>
|
|
581
|
+
<label for="embeddingTargetId">Embedding target ID *</label>
|
|
582
|
+
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
583
|
+
</div>
|
|
584
|
+
<div>
|
|
585
|
+
<label>
|
|
586
|
+
<input type="checkbox" name="useMapSrs">
|
|
587
|
+
Use map SRS
|
|
588
|
+
</label>
|
|
589
|
+
</div>
|
|
590
|
+
<div>
|
|
591
|
+
<label>
|
|
592
|
+
<input type="checkbox" name="fullGeometries">
|
|
593
|
+
Return the non-simplified geometries
|
|
594
|
+
</label>
|
|
595
|
+
</div>
|
|
596
|
+
</template>
|
|
597
|
+
|
|
571
598
|
<template data-action="getData">
|
|
572
599
|
<div>
|
|
573
600
|
<label for="dataType">Data type</label>
|