Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into new-editing
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckem committed Feb 20, 2025
2 parents 04f5983 + f327eec commit 23005b3
Show file tree
Hide file tree
Showing 49 changed files with 2,376 additions and 1,433 deletions.
7 changes: 7 additions & 0 deletions .changeset/sharp-boxes-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@open-pioneer/map": minor
---

Deprecate `mapModel.layers.getAllLayers()`.
Use `mapModel.layers.getLayers()` instead.
The name of `getAllLayers()` is misleading because it does not recurse into nested layers.
43 changes: 43 additions & 0 deletions .changeset/short-jars-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
"@open-pioneer/map": minor
---

Add function `getRecursiveLayers()` to `LayerCollection`, `SublayerCollection` and `GroupLayerCollection` in `@open-pioneer/map`

Compared to `getLayers` and `getOperationalLayers`, `getRecursiveLayer` returns all (nested) child and sub layers of a collection.
The property `options.filter` can be used to exclude layers (and their child layers) from the result. For `LayerCollection`, `getRecursiveLayers()` provides the predefined filters `base` and `operational` to return either base layers or operation layers only.

The function might be costly if the hierarchy of layers is deeply nested because the layer tree has to be traversed recursively.
In some scenarios using `options.filter` could be used to improve the performance because it is not necessary to traverse the layer tree completely if some layers are excluded.

Example (using GroupLayerCollection):

```typescript
const grouplayer = new GroupLayer({
id: "group",
title: "group test",
layers: [
new SimpleLayer({
id: "member",
title: "group member",
olLayer: olLayer1
}),
new GroupLayer({
id: "subgroup",
title: "subgroup test",
layers: [
new SimpleLayer({
id: "subgroupmember",
title: "subgroup member",
olLayer: olLayer2
})
]
})
]
});

// Returns only the layer "member" because the provided filter function excludes "subgroup" and (implicitly) its child "subgroupmember".
const layers = grouplayer.layers.getRecursiveLayers({
filter: (layer) => layer.id !== "subgroup"
});
```
5 changes: 5 additions & 0 deletions .changeset/slimy-mails-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@open-pioneer/map": patch
---

Added a configuration option to disable fetching of WMS service capabilities.
21 changes: 21 additions & 0 deletions .changeset/wicked-doors-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
"@open-pioneer/toc": minor
---

Adds the optional functionality to collapse and expand groups in the TOC.
This option can be activated with the `collapsibleGroups` property (default is `false`).
If the property `initiallyCollapsed` is `true` all groups are collapsed by default when the TOC is rendered. This is helpful if the app has a large layer tree.
Additionally, a menu item to collapse all groups can be added to the Tools section by setting `toolsConfig.showCollapseAllGroups` to `true` (default is `true`).
This is only applicable if `collapsibleGroups` and `showTools` are both `true`.

```jsx
import { Toc } from "@open-pioneer/toc";

<Toc
mapId={MAP_ID}
showTools={true}
collapsibleGroups={true} //groups are collapsible in TOC
initiallyCollapsed={true} //groups are collapsed initially
toolsConfig={{ showCollapseAllGroups: true }} //show 'collapse all' menu item in Tools
/>;
```
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"vite-plugin-eslint>rollup: https://github.com/advisories/GHSA-gcx4-mw62-g8wm",
"cross-spawn: https://github.com/advisories/GHSA-3xgq-45jj-v275",
"nanoid: https://github.com/advisories/GHSA-mwcw-c2x4-8c55",
"dompurify: CVE-2025-26791",
"esbuild: https://github.com/advisories/GHSA-67mh-4wv8-2f99",
"",
"ignored cves",
"============",
Expand All @@ -61,7 +63,9 @@
"micromatch@<4.0.8": ">=4.0.8",
"vite-plugin-eslint>rollup": ">=3.29.5",
"cross-spawn@<7.0.5": ">=7.0.5",
"nanoid@<3.3.8": "^3.3.8"
"nanoid@<3.3.8": "^3.3.8",
"dompurify@<3.2.4": ">=3.2.4",
"esbuild@<0.25.0": ">=0.25.0"
},
"auditConfig": {
"ignoreCves": []
Expand Down
Loading

0 comments on commit 23005b3

Please sign in to comment.