-
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.
Browse files
Browse the repository at this point in the history
--------- Co-authored-by: Antonia van Eek <a.vaneek@conterra.de> Co-authored-by: Arne Vogt <a.vogt@52north.org>
- Loading branch information
1 parent
377de9f
commit e7978a8
Showing
55 changed files
with
893 additions
and
1,121 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,26 @@ | ||
--- | ||
"@open-pioneer/selection": minor | ||
--- | ||
|
||
Support reactive changes on the `SelectionSource`'s `status` property using the reactivity API. | ||
**Remove** support for the `changed:status"` event on the selection source: use signals instead. | ||
|
||
For example, to implement a `SelectionSource` with changing availability: | ||
|
||
```ts | ||
class MySelectionSource implements SelectionSource { | ||
private _status = reactive("available"); | ||
|
||
label = "My selection source"; | ||
|
||
get status() { | ||
return this._status.value; | ||
} | ||
|
||
someEventHandler() { | ||
// Change the status by updating the signal's value. | ||
// The UI will update automatically. | ||
this._status.value = "unavailable"; | ||
} | ||
} | ||
``` |
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,40 @@ | ||
--- | ||
"@open-pioneer/map": minor | ||
--- | ||
|
||
- **Breaking:** Remove most events from the map model and the layer interfaces. | ||
All events that were merely used to synchronized state (e.g. `changed:title` etc.) have been removed. | ||
|
||
The map model and related objects (layers, layer collections, etc.) are now based on the [Reactivity API](https://github.com/conterra/reactivity/blob/main/packages/reactivity-core/README.md). | ||
This change greatly simplifies the code that is necessary to access up-to-date values and to react to changes. | ||
|
||
For example, from inside a React component, you can now write: | ||
|
||
```jsx | ||
import { useReactiveSnapshot } from "@open-pioneer/reactivity"; | ||
|
||
function YourComponent() { | ||
// Always up to date, even if the layer's title changes. | ||
// No more need to listen to events. | ||
const title = useReactiveSnapshot(() => layer.title, [layer]); | ||
return <div>{title}</div>; | ||
} | ||
``` | ||
|
||
And inside a normal JavaScript function, you can watch for changes like this: | ||
|
||
```js | ||
import { watch } from "@conterra/reactivity-core"; | ||
|
||
const watchHandle = watch( | ||
() => [layer.title], | ||
([newTitle]) => { | ||
console.log("The title changed to", newTitle); | ||
}, | ||
); | ||
|
||
// Later, cleanup: | ||
watchHandle.destroy(); | ||
``` | ||
|
||
For more details, check the [Reactivity API documentation](https://github.com/conterra/reactivity/blob/main/packages/reactivity-core/README.md). |
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/basemap-switcher": patch | ||
--- | ||
|
||
Use reactive map model APIs to access the current set of basemaps. |
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/toc": patch | ||
--- | ||
|
||
Use reactive map model APIs to access the current set of layers and their attributes. |
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/editing": minor | ||
--- | ||
|
||
Removed EditingWorkflowEvent; the state of the EditingWorkflow is now reactive and should be used instead. |
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/editing": patch | ||
--- | ||
|
||
Use reactive map model APIs to access the current map container element. |
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/legend": patch | ||
--- | ||
|
||
Use reactive map model APIs to access the current layers and their attributes. |
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/editing": patch | ||
--- | ||
|
||
Stop draw interactions and remove tooltips before saving. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.