@open-pioneer/selection 0.8.0-dev.20241120115147 → 0.9.0-dev.20250217152428
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -2
- package/VectorSelectionSource.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# @open-pioneer/selection
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.9.0-dev.20250217152428
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [209eb8e]
|
|
8
|
+
- @open-pioneer/map@0.9.0-dev.20250217152428
|
|
9
|
+
|
|
10
|
+
## 0.8.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
6
13
|
|
|
@@ -38,15 +45,18 @@
|
|
|
38
45
|
|
|
39
46
|
### Patch Changes
|
|
40
47
|
|
|
48
|
+
- 49f0207: Update trails core packages to version 2.4.0
|
|
41
49
|
- Updated dependencies [b717121]
|
|
42
50
|
- Updated dependencies [e7978a8]
|
|
51
|
+
- Updated dependencies [7a5f1e1]
|
|
43
52
|
- Updated dependencies [7ae9f90]
|
|
44
53
|
- Updated dependencies [d8337a6]
|
|
54
|
+
- Updated dependencies [49f0207]
|
|
45
55
|
- Updated dependencies [b2127df]
|
|
46
56
|
- Updated dependencies [2fa8020]
|
|
47
57
|
- Updated dependencies [7ae9f90]
|
|
48
58
|
- Updated dependencies [d8337a6]
|
|
49
|
-
- @open-pioneer/map@0.8.0
|
|
59
|
+
- @open-pioneer/map@0.8.0
|
|
50
60
|
|
|
51
61
|
## 0.7.0
|
|
52
62
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorSelectionSource.js","sources":["VectorSelectionSource.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport {\n SelectionResult,\n SelectionOptions,\n SelectionSourceStatus,\n SelectionKind,\n VectorLayerSelectionSource,\n SelectionSourceStatusObject\n} from \"./api\";\nimport VectorLayer from \"ol/layer/Vector\";\nimport { EventsKey } from \"ol/events\";\nimport { unByKey } from \"ol/Observable\";\nimport { v4 as uuid4v } from \"uuid\";\nimport Feature from \"ol/Feature\";\nimport { reactive } from \"@conterra/reactivity-core\";\nimport VectorSource from \"ol/source/Vector\";\n\n/**\n * A SelectionSource to use an OpenLayers VectorLayer with an OpenLayers VectorSource (e.g. layer of the map).\n * Features are:\n * - using only the extent as selection kind\n * - listening to layer visibility changes and updating the status of the source\n * - limiting the number of returned selection results to the corresponding selection option\n * - throwing an event `changed:status` when the status updates\n */\nexport class VectorLayerSelectionSourceImpl implements VectorLayerSelectionSource {\n readonly label: string;\n #status = reactive<SelectionSourceStatusObject>({ kind: \"available\" });\n #vectorLayer: VectorLayer<VectorSource, Feature>;\n #eventHandler: EventsKey;\n #layerNotVisibleReason: string;\n\n constructor(vectorLayer: VectorLayer<VectorSource, Feature
|
|
1
|
+
{"version":3,"file":"VectorSelectionSource.js","sources":["VectorSelectionSource.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport {\n SelectionResult,\n SelectionOptions,\n SelectionSourceStatus,\n SelectionKind,\n VectorLayerSelectionSource,\n SelectionSourceStatusObject\n} from \"./api\";\nimport VectorLayer from \"ol/layer/Vector\";\nimport { EventsKey } from \"ol/events\";\nimport { unByKey } from \"ol/Observable\";\nimport { v4 as uuid4v } from \"uuid\";\nimport Feature from \"ol/Feature\";\nimport { reactive } from \"@conterra/reactivity-core\";\nimport VectorSource from \"ol/source/Vector\";\n\n/**\n * A SelectionSource to use an OpenLayers VectorLayer with an OpenLayers VectorSource (e.g. layer of the map).\n * Features are:\n * - using only the extent as selection kind\n * - listening to layer visibility changes and updating the status of the source\n * - limiting the number of returned selection results to the corresponding selection option\n * - throwing an event `changed:status` when the status updates\n */\nexport class VectorLayerSelectionSourceImpl implements VectorLayerSelectionSource {\n readonly label: string;\n #status = reactive<SelectionSourceStatusObject>({ kind: \"available\" });\n #vectorLayer: VectorLayer<VectorSource, Feature>;\n #eventHandler: EventsKey;\n #layerNotVisibleReason: string;\n\n constructor(\n vectorLayer: VectorLayer<VectorSource, Feature>,\n label: string,\n layerNotVisibleReason: string\n ) {\n this.label = label;\n this.#vectorLayer = vectorLayer;\n this.#layerNotVisibleReason = layerNotVisibleReason;\n this.#updateStatus();\n this.#eventHandler = this.#vectorLayer.on(\"change:visible\", () => {\n this.#updateStatus();\n });\n }\n\n destroy() {\n unByKey(this.#eventHandler);\n }\n\n get status() {\n return this.#status.value;\n }\n\n async select(\n selectionKind: SelectionKind,\n options: SelectionOptions\n ): Promise<SelectionResult[]> {\n if (selectionKind.type !== \"extent\") {\n throw new Error(`Unsupported selection kind: ${selectionKind.type}`);\n }\n\n if (this.#status.value.kind !== \"available\" || this.#vectorLayer.getSource() === null)\n return [];\n\n const allResults: SelectionResult[] = [];\n this.#vectorLayer\n .getSource()!\n .forEachFeatureIntersectingExtent(selectionKind.extent, (feature) => {\n if (!feature.getGeometry()) return;\n\n // TODO: Think about where to implement Date-Formatting, if the dates are already\n // encoded as Strings...\n\n const filteredProperties = { ...feature.getProperties() };\n delete filteredProperties.geometries;\n\n const result: SelectionResult = {\n id: feature.getId()?.toString() || uuid4v(),\n geometry: feature.getGeometry()!,\n properties: filteredProperties\n };\n\n allResults.push(result);\n });\n const selectedFeatures = allResults.filter((s): s is SelectionResult => s != null);\n const limitedFeatures =\n selectedFeatures.length > options.maxResults\n ? selectedFeatures.slice(0, options.maxResults)\n : selectedFeatures;\n return limitedFeatures;\n }\n\n #updateStatus() {\n const layerIsVisible = this.#vectorLayer.getVisible();\n const newStatus: SelectionSourceStatus = layerIsVisible\n ? { kind: \"available\" }\n : { kind: \"unavailable\", reason: this.#layerNotVisibleReason };\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AA,CAAK,QAAQ,KAAQ,GAAA,SAAA,CAAA;AAAA,KACzB;AAAA,GACJ;AACJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/selection",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0-dev.20250217152428",
|
|
5
5
|
"description": "This package provides a UI component to perform a selection on given selection sources from the map.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -15,20 +15,20 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@chakra-ui/icons": "^2.2.4",
|
|
18
|
-
"@open-pioneer/chakra-integration": "^2.4.0
|
|
19
|
-
"@open-pioneer/core": "^2.4.0
|
|
20
|
-
"@open-pioneer/notifier": "^2.4.0
|
|
21
|
-
"@open-pioneer/react-utils": "^2.4.0
|
|
22
|
-
"@open-pioneer/runtime": "^2.4.0
|
|
18
|
+
"@open-pioneer/chakra-integration": "^2.4.0",
|
|
19
|
+
"@open-pioneer/core": "^2.4.0",
|
|
20
|
+
"@open-pioneer/notifier": "^2.4.0",
|
|
21
|
+
"@open-pioneer/react-utils": "^2.4.0",
|
|
22
|
+
"@open-pioneer/runtime": "^2.4.0",
|
|
23
23
|
"classnames": "^2.3.2",
|
|
24
24
|
"chakra-react-select": "^5.0.2",
|
|
25
|
-
"ol": "^10.
|
|
25
|
+
"ol": "^10.3.0",
|
|
26
26
|
"react": "^18.3.1",
|
|
27
27
|
"react-icons": "^5.3.0",
|
|
28
28
|
"uuid": "^10.0.0",
|
|
29
29
|
"@conterra/reactivity-core": "^0.4.3",
|
|
30
|
-
"@open-pioneer/reactivity": "^2.4.0
|
|
31
|
-
"@open-pioneer/map": "^0.
|
|
30
|
+
"@open-pioneer/reactivity": "^2.4.0",
|
|
31
|
+
"@open-pioneer/map": "^0.9.0-dev.20250217152428"
|
|
32
32
|
},
|
|
33
33
|
"exports": {
|
|
34
34
|
"./package.json": "./package.json",
|