From 30d43f76e9f39de94462685404ce8bc351504e64 Mon Sep 17 00:00:00 2001 From: klschm <32072325+klschm@users.noreply.github.com> Date: Mon, 25 Nov 2024 18:43:03 +0100 Subject: [PATCH] =?UTF-8?q?CADENZA-37531=20Fix=20geometry=20zooming=20beha?= =?UTF-8?q?viour=20to=20equal=20the=20behaviour=20i=E2=80=A6=20(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * CADENZA-37531 Fix geometry zooming behaviour to equal the behaviour it was present before the project * CADENZA-37531 Add the changelog entry for my bugfix * CADENZA-37531 Add comment for priorization of the extent strategies --- CHANGELOG.md | 3 +++ src/cadenza.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a1690fc..00e7ccba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ This project uses a version scheme based on the Cadenza main version in the form ## Unreleased +### Fixed +- `geometry` parameter now applies again as `GeometryExtentStrategy` + ## 10.2.5 - 2024-11-25 ### Added - 'Additional Layers' to the sandbox of 'Edit Geometry' diff --git a/src/cadenza.js b/src/cadenza.js index 9895e247..a350c23d 100644 --- a/src/cadenza.js +++ b/src/cadenza.js @@ -1429,7 +1429,7 @@ function array(/** @type unknown */ value) { /** * Creates a valid extent strategy based on these rules: - * - `extentStrategy` trumps `mapExtent`, `mapExtent` trumps `locationFinder`. + * - `extentStrategy` trumps `geometry`, `geometry` trumps `mapExtent`, `mapExtent` trumps `locationFinder`. * - `mapExtent`, `locationFinder`, and `geometry` are used as fallback for * {@link StaticExtentStrategy#extent}, {@link LocationFinderExtentStrategy#query}, * and {@link GeometryExtentStrategy#geometry} respectively. @@ -1473,6 +1473,9 @@ function sanitizeExtentStrategy({ return extentStrategy; } } + if (geometry) { + return { type: 'geometry', geometry }; + } if (mapExtent) { return { type: 'static', extent: mapExtent }; }