@disy/cadenza.js 10.4.0 → 10.4.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 +13 -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 +69 -72
- package/apidoc/classes/CadenzaError.html +5 -5
- package/apidoc/functions/cadenza.html +4 -4
- package/apidoc/index.html +9 -16
- package/apidoc/interfaces/CadenzaClientOptions.html +5 -5
- package/apidoc/interfaces/CadenzaEvent.html +4 -4
- package/apidoc/interfaces/CommonEditGeometryOptions.html +20 -0
- 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/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/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 +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 +6 -0
- 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/cadenza.d.ts +97 -68
- package/cadenza.js +182 -79
- package/package.json +1 -1
- package/sandbox.html +108 -40
package/sandbox.html
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
display: flex;
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
gap: var(--gap);
|
|
42
|
-
overflow:
|
|
42
|
+
overflow: hidden auto;
|
|
43
43
|
}
|
|
44
44
|
fieldset > div {
|
|
45
45
|
display: flex;
|
|
@@ -153,7 +153,8 @@
|
|
|
153
153
|
closeMe: () => cadenzaClient.closeMe(),
|
|
154
154
|
getData: async data => {
|
|
155
155
|
const dataType = data.dataType;
|
|
156
|
-
const
|
|
156
|
+
const options = getOptions(data);
|
|
157
|
+
const result = await cadenzaClient.getData(dataType, options);
|
|
157
158
|
if (dataType === 'png') {
|
|
158
159
|
const url = URL.createObjectURL(result);
|
|
159
160
|
iframe.src = url;
|
|
@@ -166,7 +167,9 @@
|
|
|
166
167
|
addSelection: data => cadenzaClient.addSelection(JSON.parse(data.layer), JSON.parse(data.objectIds), { extentStrategy: JSON.parse(data.extentStrategy) }),
|
|
167
168
|
removeSelection: data => cadenzaClient.removeSelection(JSON.parse(data.layer), JSON.parse(data.objectIds), { extentStrategy: JSON.parse(data.extentStrategy) }),
|
|
168
169
|
createGeometry: (data, formData) => cadenzaClient.createGeometry(data.embeddingTargetId, data.geometryType, getOptions(data, formData)),
|
|
169
|
-
editGeometry: (
|
|
170
|
+
editGeometry: (data, formData) => cadenzaClient.editGeometry(data.embeddingTargetId, JSON.parse(data.geometry), getOptions(data, formData)),
|
|
171
|
+
batchCreateGeometry: (data , formData) => cadenzaClient.batchCreateGeometry(data.embeddingTargetId, data.geometryType, getOptions(data, formData)),
|
|
172
|
+
batchEditGeometry: (data, formData) => cadenzaClient.batchEditGeometry(data.embeddingTargetId, JSON.parse(data.features), getOptions(data, formData)),
|
|
170
173
|
selectObjects: data => cadenzaClient.selectObjects(data.embeddingTargetId, getOptions(data)),
|
|
171
174
|
fetchData: data => {
|
|
172
175
|
console.log('Inspect the fetchData() request in the devtools.');
|
|
@@ -215,6 +218,7 @@
|
|
|
215
218
|
function getOptions ({
|
|
216
219
|
additionalLayers,
|
|
217
220
|
disabledUiFeatures,
|
|
221
|
+
dataType,
|
|
218
222
|
distance,
|
|
219
223
|
expandNavigator,
|
|
220
224
|
extentStrategy,
|
|
@@ -222,6 +226,7 @@
|
|
|
222
226
|
fileName,
|
|
223
227
|
filter,
|
|
224
228
|
geometry,
|
|
229
|
+
height,
|
|
225
230
|
hideMainHeaderAndFooter,
|
|
226
231
|
hideWorkbookToolBar,
|
|
227
232
|
highlightGlobalId,
|
|
@@ -234,11 +239,15 @@
|
|
|
234
239
|
simplifiedOperationMode,
|
|
235
240
|
snappingLayer,
|
|
236
241
|
useMapSrs,
|
|
242
|
+
layout,
|
|
243
|
+
width,
|
|
244
|
+
withScale,
|
|
237
245
|
}, formData) {
|
|
238
246
|
return {
|
|
239
247
|
additionalLayers: additionalLayers && JSON.parse(additionalLayers),
|
|
240
248
|
buffer: distance ? { value: Number(distance), lengthUnit: lengthUnit ? lengthUnit : 'm' } : undefined,
|
|
241
249
|
...(requestAsPdf === 'on' && { dataType: 'pdf' }),
|
|
250
|
+
dataType: dataType,
|
|
242
251
|
disabledUiFeatures: disabledUiFeatures && disabledUiFeatures.split(','),
|
|
243
252
|
expandNavigator: (expandNavigator === 'on'),
|
|
244
253
|
extentStrategy: extentStrategy && JSON.parse(extentStrategy),
|
|
@@ -246,6 +255,7 @@
|
|
|
246
255
|
filter: filter && parseFilterVariables(filter),
|
|
247
256
|
fullGeometries: fullGeometries === 'on',
|
|
248
257
|
geometry: geometry && JSON.parse(geometry),
|
|
258
|
+
height: Number(height),
|
|
249
259
|
hideMainHeaderAndFooter: (hideMainHeaderAndFooter === 'on'),
|
|
250
260
|
hideWorkbookToolBar: (hideWorkbookToolBar === 'on'),
|
|
251
261
|
highlightGlobalId,
|
|
@@ -259,6 +269,9 @@
|
|
|
259
269
|
types: formData?.getAll('snappingTypes')
|
|
260
270
|
}: undefined,
|
|
261
271
|
useMapSrs: useMapSrs === 'on',
|
|
272
|
+
layout: layout || undefined,
|
|
273
|
+
width: Number(width),
|
|
274
|
+
withScale: Boolean(withScale),
|
|
262
275
|
};
|
|
263
276
|
}
|
|
264
277
|
|
|
@@ -290,7 +303,7 @@
|
|
|
290
303
|
</optgroup>
|
|
291
304
|
<optgroup label="Interact With Shown Content">
|
|
292
305
|
<option value="expandNavigator">Expand Navigator</option>
|
|
293
|
-
<option value="getData"
|
|
306
|
+
<option value="getData">Get Data (Get Map Image)</option>
|
|
294
307
|
<option value="setFilter" class="unpublished">Set Filter</option>
|
|
295
308
|
<option value="setLayerVisibility" class="unpublished">Set Layer Visibility</option>
|
|
296
309
|
<option value="setSelection" class="unpublished">Set Selection</option>
|
|
@@ -302,6 +315,8 @@
|
|
|
302
315
|
<optgroup label="Map Dialogs">
|
|
303
316
|
<option value="createGeometry">Create Geometry</option>
|
|
304
317
|
<option value="editGeometry">Edit Geometry</option>
|
|
318
|
+
<option value="batchCreateGeometry">Batch Create Geometry</option>
|
|
319
|
+
<option value="batchEditGeometry">Batch Edit Geometry</option>
|
|
305
320
|
<option value="selectObjects">Select Objects</option>
|
|
306
321
|
<option value="setCustomValidity">Set Custom Validity</option>
|
|
307
322
|
</optgroup>
|
|
@@ -362,6 +377,14 @@
|
|
|
362
377
|
Expand navigator tree
|
|
363
378
|
</label>
|
|
364
379
|
</div>
|
|
380
|
+
<div>
|
|
381
|
+
<label for="layout">Layout</label>
|
|
382
|
+
<select id="layout" name="layout">
|
|
383
|
+
<option value="" selected>Default</option>
|
|
384
|
+
<option value="linear">Linear</option>
|
|
385
|
+
<option value="dashboard">Dashboard</option>
|
|
386
|
+
</select>
|
|
387
|
+
</div>
|
|
365
388
|
</template>
|
|
366
389
|
|
|
367
390
|
<template id="common-disabledUiFeatures">
|
|
@@ -519,35 +542,14 @@
|
|
|
519
542
|
|
|
520
543
|
<template data-action="setFilter" data-common="filter"></template>
|
|
521
544
|
|
|
522
|
-
<template data-action="createGeometry" data-common="additionalLayers,extentStrategy,map,snapping,disabledUiFeatures,filter">
|
|
545
|
+
<template data-action="createGeometry" data-common="geometryType,simplifiedOperationMode,minimumScale,additionalLayers,extentStrategy,map,snapping,disabledUiFeatures,filter">
|
|
523
546
|
<div>
|
|
524
547
|
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
525
548
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
526
549
|
</div>
|
|
527
|
-
<div>
|
|
528
|
-
<label for="geometryType">Geometry type</label>
|
|
529
|
-
<select name="geometryType" id="geometryType">
|
|
530
|
-
<option>Point</option>
|
|
531
|
-
<option>MultiPoint</option>
|
|
532
|
-
<option>LineString</option>
|
|
533
|
-
<option>MultiLineString</option>
|
|
534
|
-
<option>Polygon</option>
|
|
535
|
-
<option>MultiPolygon</option>
|
|
536
|
-
</select>
|
|
537
|
-
</div>
|
|
538
|
-
<div>
|
|
539
|
-
<label>
|
|
540
|
-
<input type="checkbox" name="simplifiedOperationMode">
|
|
541
|
-
Simplified operation mode
|
|
542
|
-
</label>
|
|
543
|
-
</div>
|
|
544
|
-
<div>
|
|
545
|
-
<label for="minScale">Minimum Scale</label>
|
|
546
|
-
<input type="number" name="minScale" id="minScale">
|
|
547
|
-
</div>
|
|
548
550
|
</template>
|
|
549
551
|
|
|
550
|
-
<template data-action="editGeometry" data-common="additionalLayers,extentStrategy,map,snapping,disabledUiFeatures,filter">
|
|
552
|
+
<template data-action="editGeometry" data-common="simplifiedOperationMode,minimumScale,additionalLayers,extentStrategy,map,snapping,disabledUiFeatures,filter">
|
|
551
553
|
<div>
|
|
552
554
|
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
553
555
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
@@ -572,15 +574,47 @@
|
|
|
572
574
|
</pre>
|
|
573
575
|
</small>
|
|
574
576
|
</div>
|
|
577
|
+
</template>
|
|
578
|
+
|
|
579
|
+
<template data-action="batchCreateGeometry" data-common="geometryType,simplifiedOperationMode,minimumScale,additionalLayers,extentStrategy,map,snapping,disabledUiFeatures,filter">
|
|
575
580
|
<div>
|
|
576
|
-
<label>
|
|
577
|
-
|
|
578
|
-
Simplified operation mode
|
|
579
|
-
</label>
|
|
581
|
+
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
582
|
+
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
580
583
|
</div>
|
|
584
|
+
</template>
|
|
585
|
+
|
|
586
|
+
<template data-action="batchEditGeometry" data-common="simplifiedOperationMode,minimumScale,additionalLayers,extentStrategy,map,snapping,disabledUiFeatures,filter">
|
|
581
587
|
<div>
|
|
582
|
-
<label for="
|
|
583
|
-
<input
|
|
588
|
+
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
589
|
+
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
590
|
+
</div>
|
|
591
|
+
<div>
|
|
592
|
+
<label for="features">Features (GeoJSON)</label>
|
|
593
|
+
<textarea name="features" id="features" rows="10" required></textarea>
|
|
594
|
+
<small>
|
|
595
|
+
<strong>Example:</strong>
|
|
596
|
+
<pre>
|
|
597
|
+
{
|
|
598
|
+
"type":"FeatureCollection",
|
|
599
|
+
"features":[
|
|
600
|
+
{
|
|
601
|
+
"type":"Feature",
|
|
602
|
+
"geometry":{
|
|
603
|
+
"coordinates":[
|
|
604
|
+
[
|
|
605
|
+
[7.96,47.93],
|
|
606
|
+
[7.90,47.64],
|
|
607
|
+
[8.31,47.70],
|
|
608
|
+
[7.96,47.93]
|
|
609
|
+
]
|
|
610
|
+
],
|
|
611
|
+
"type":"Polygon"
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
]
|
|
615
|
+
}
|
|
616
|
+
</pre>
|
|
617
|
+
</small>
|
|
584
618
|
</div>
|
|
585
619
|
</template>
|
|
586
620
|
|
|
@@ -620,17 +654,11 @@
|
|
|
620
654
|
</div>
|
|
621
655
|
</template>
|
|
622
656
|
|
|
623
|
-
<template data-action="selectObjects" data-common="extentStrategy,map,filter">
|
|
657
|
+
<template data-action="selectObjects" data-common="simplifiedOperationMode,extentStrategy,map,filter">
|
|
624
658
|
<div>
|
|
625
659
|
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
626
660
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
627
661
|
</div>
|
|
628
|
-
<div>
|
|
629
|
-
<label>
|
|
630
|
-
<input type="checkbox" name="simplifiedOperationMode">
|
|
631
|
-
Simplified operation mode
|
|
632
|
-
</label>
|
|
633
|
-
</div>
|
|
634
662
|
<div>
|
|
635
663
|
<label for="layers">Layers</label>
|
|
636
664
|
<input name="layers" id="layers">
|
|
@@ -666,6 +694,36 @@
|
|
|
666
694
|
</template>
|
|
667
695
|
<template data-action="closeMe">No Parameters needed.</template>
|
|
668
696
|
|
|
697
|
+
<template id="common-geometryType">
|
|
698
|
+
<div>
|
|
699
|
+
<label for="geometryType">Geometry type</label>
|
|
700
|
+
<select name="geometryType" id="geometryType">
|
|
701
|
+
<option>Point</option>
|
|
702
|
+
<option>MultiPoint</option>
|
|
703
|
+
<option>LineString</option>
|
|
704
|
+
<option>MultiLineString</option>
|
|
705
|
+
<option>Polygon</option>
|
|
706
|
+
<option>MultiPolygon</option>
|
|
707
|
+
</select>
|
|
708
|
+
</div>
|
|
709
|
+
</template>
|
|
710
|
+
|
|
711
|
+
<template id="common-simplifiedOperationMode">
|
|
712
|
+
<div>
|
|
713
|
+
<label>
|
|
714
|
+
<input type="checkbox" name="simplifiedOperationMode">
|
|
715
|
+
Simplified operation mode
|
|
716
|
+
</label>
|
|
717
|
+
</div>
|
|
718
|
+
</template>
|
|
719
|
+
|
|
720
|
+
<template id="common-minimumScale">
|
|
721
|
+
<div>
|
|
722
|
+
<label for="minScale">Minimum Scale</label>
|
|
723
|
+
<input type="number" name="minScale" id="minScale">
|
|
724
|
+
</div>
|
|
725
|
+
</template>
|
|
726
|
+
|
|
669
727
|
<template id="common-object-ids">
|
|
670
728
|
<div>
|
|
671
729
|
<label for="objectids">List of object ID value lists *</label>
|
|
@@ -888,6 +946,16 @@
|
|
|
888
946
|
<small>
|
|
889
947
|
<p>Currently, only <code>dataType=png</code> is supported to get the image of the currently shown workbook map view.</p>
|
|
890
948
|
</small>
|
|
949
|
+
<hr>
|
|
950
|
+
<label for="width">Width</label>
|
|
951
|
+
<input name="width" id="width" type="number" min="0">
|
|
952
|
+
<label for="height">Height</label>
|
|
953
|
+
<input name="height" id="height" type="number" min="0">
|
|
954
|
+
<hr>
|
|
955
|
+
<label for="withScale">
|
|
956
|
+
<input name="withScale" id="withScale" type="checkbox" >
|
|
957
|
+
Include scale
|
|
958
|
+
</label>
|
|
891
959
|
</div>
|
|
892
960
|
</template>
|
|
893
961
|
|