Skip to content

Commit

Permalink
CADENZA-37531 and CADENZA-38242: (#71)
Browse files Browse the repository at this point in the history
* CADENZA-37531 and CADENZA-38242:
- Handle 'layerData' extentStrategy correctly
- Reformat 'locationFinder' example in sandbox

* CADENZA-37531 and CADENZA-38242:
- Fix 'layerData' example

* CADENZA-37531 and CADENZA-38242:
- Replace 'layerData' with default when sanitizing the extent strategies
  • Loading branch information
klschm authored Nov 25, 2024
1 parent 915cb2e commit 087408d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions sandbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -700,15 +700,18 @@
"type":"Polygon"
}
}</pre></li>
<li><pre>{"type": "locationFinder", "query": "Hamburg"}</pre></li>
<li><pre>{
"type": "locationFinder",
"query": "Hamburg"
}</pre></li>
<li><pre>{
"type": "static",
"extent": [9.585571,53.38169,10.483704,53.859007]
}</pre></li>
<li><pre>{"type": "layerData"}</pre></li>
<li><pre>{
"type": "layerData",
"layers": ["Messstellen", "Gewässer"]
"layers": ["Messstellen", ["Gewässer", "Gewässername"]]
}</pre></li>
</ul>
</p>
Expand Down
4 changes: 3 additions & 1 deletion src/cadenza.js
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ export class CadenzaClient {
#setExtentStrategy(/** @type {ExtentStrategy | undefined} */ extentStrategy) {
const type = extentStrategy?.type;
// Other extent strategies are handled via URL parameters.
if (type === 'geometry' || type === 'static') {
if (type === 'geometry' || type === 'layerData') {
this.#postEvent('setExtentStrategy', extentStrategy);
}
}
Expand Down Expand Up @@ -1469,6 +1469,8 @@ function sanitizeExtentStrategy({
return { type: 'geometry', geometry };
}
break;
default:
return extentStrategy;
}
}
if (mapExtent) {
Expand Down

0 comments on commit 087408d

Please sign in to comment.