-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into new-editing
- Loading branch information
Showing
49 changed files
with
2,376 additions
and
1,433 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
/>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.