From 768327251aed7dd0a52d55c86214acb427032dc0 Mon Sep 17 00:00:00 2001 From: JensLuebke Date: Fri, 23 Aug 2024 10:54:40 +0200 Subject: [PATCH] CADENZA-36890 Add the object info to cadenza.js and sandbox.html (#36) * CADENZA-36890 Add the object info to cadenza.js and sandbox.html * CADENZA-36890 Add documentation * CADENZA-36890 Add to CHANGELOG.md * CADENZA-36890 Fix the header creation * use <> instead of {} for placeholders in docs to avoid confusion in JSON examples * add support for dataType=pdf in CadenzaClient#downloadData and #fetchData * chore: release v2.11.0 * include version * CADENZA-36890 Add to CHANGELOG.md * CADENZA-36890 Review changes * CADENZA-36890 Review changes * CADENZA-36890 changed the name of the feature id * CADENZA-36890 layerPath is not optional for fetchObjectInfo * CADENZA-36890 code format --------- Co-authored-by: luebke Co-authored-by: kissel Co-authored-by: github-actions[bot] Co-authored-by: Andreas W. Bartels --- CHANGELOG.md | 2 ++ sandbox.html | 47 +++++++++++++++++++++++++-------- src/cadenza.js | 70 +++++++++++++++++++++++++++++++++++++++++++++----- src/docs.md | 15 +++++++++++ 4 files changed, 117 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ae71826..eb7c6969 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +### Added +- `CadenzaClient#fetchObjectInfo` ## 2.11.0 - 2024-07-12 ### Added diff --git a/sandbox.html b/sandbox.html index c5aebac5..07359a72 100644 --- a/sandbox.html +++ b/sandbox.html @@ -161,9 +161,9 @@ }, setFilter: data => cadenzaClient.setFilter(parseFilterVariables(data.filter)), setLayerVisibility: data => cadenzaClient.setLayerVisibility(JSON.parse(data.layer), data.visibility === 'on'), - setSelection: data => cadenzaClient.setSelection(JSON.parse(data.layer), JSON.parse(data.values)), - addSelection: data => cadenzaClient.addSelection(JSON.parse(data.layer), JSON.parse(data.values)), - removeSelection: data => cadenzaClient.removeSelection(JSON.parse(data.layer), JSON.parse(data.values)), + setSelection: data => cadenzaClient.setSelection(JSON.parse(data.layer), JSON.parse(data.objectIds)), + addSelection: data => cadenzaClient.addSelection(JSON.parse(data.layer), JSON.parse(data.objectIds)), + removeSelection: data => cadenzaClient.removeSelection(JSON.parse(data.layer), JSON.parse(data.objectIds)), createGeometry: data => cadenzaClient.createGeometry(data.embeddingTargetId, data.geometryType, getOptions(data)), editGeometry: ({ geometry, ...data }) => cadenzaClient.editGeometry(data.embeddingTargetId, JSON.parse(geometry), getOptions(data)), selectObjects: data => cadenzaClient.selectObjects(data.embeddingTargetId, getOptions(data)), @@ -171,6 +171,11 @@ console.log('Inspect the fetchData() request in the devtools.'); cadenzaClient.fetchData(data.embeddingTargetId, data.dataType, getOptions(data)); }, + fetchObjectInfo: data => { + console.log('Inspect the fetchObjectInfo() request in the devtools.'); + cadenzaClient.fetchObjectInfo(data.embeddingTargetId, JSON.parse(data.layer), JSON.parse(data.objectIds), getOptions(data)) + .then(oi => console.log(oi)); + }, downloadData: data => cadenzaClient.downloadData(data.embeddingTargetId, data.dataType, getOptions(data)) }; @@ -217,6 +222,7 @@ layers, simplifiedOperationMode, useMapSrs, + fullGeometries, zoomToGeometry }) { return { @@ -237,6 +243,7 @@ ...(simplifiedOperationMode === 'on' && { operationMode: 'simplified' }), layers: layers ? JSON.parse(layers) : undefined, useMapSrs: useMapSrs === 'on', + fullGeometries: fullGeometries === 'on', zoomTarget: zoomToGeometry === 'on' ? { type: 'geometry' } : undefined }; } @@ -286,6 +293,7 @@ + @@ -520,9 +528,9 @@ - - - + + + - + +