-
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: Michael Beckemeyer <m.beckemeyer@conterra.de> Co-authored-by: Arne Vogt <a.vogt@52north.org>
- Loading branch information
1 parent
595becb
commit d8337a6
Showing
20 changed files
with
306 additions
and
104 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,21 @@ | ||
--- | ||
"@open-pioneer/map": minor | ||
--- | ||
|
||
The following hooks are deprecated and will be removed in a future release: | ||
|
||
- `useView` | ||
- `useProjection` | ||
- `useResolution` | ||
- `useCenter` | ||
- `useScale` | ||
|
||
They can all be replaced by using the new reactive properties on the `MapModel`, for example: | ||
|
||
```javascript | ||
// old: | ||
const center = useCenter(olMap); | ||
|
||
// new: | ||
const center = useReactiveSnapshot(() => mapModel.center, [mapModel]); | ||
``` |
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,10 @@ | ||
--- | ||
"@open-pioneer/coordinate-viewer": patch | ||
"@open-pioneer/spatial-bookmarks": patch | ||
"@open-pioneer/map-navigation": patch | ||
"@open-pioneer/scale-setter": patch | ||
"@open-pioneer/scale-viewer": patch | ||
"@open-pioneer/geolocation": patch | ||
--- | ||
|
||
Refactor implementation to use the new reactive properties of the map model. |
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,17 @@ | ||
--- | ||
"@open-pioneer/map": minor | ||
--- | ||
|
||
Provide new reactive properties on the `MapModel` type. | ||
|
||
- `olView` (-> `olMap.getView()`) | ||
- `projection` (-> `olMap.getView().getProjection()`) | ||
- `resolution` (-> `olMap.getView().getResolution()`) | ||
- `zoomLevel` (-> `olMap.getView().getZoom()`) | ||
- `center` (-> `olMap.getView().getCenter()`) | ||
- `scale` (derived from center and resolution) | ||
|
||
Most of the listed properties are already available on raw OpenLayers objects (see code in parentheses above). | ||
However, those OpenLayers properties require manual work for synchronization, whereas the new properties are reactive (and can be watched, for example, using `useReactiveSnapshot()`). | ||
|
||
A new method `setScale()` has also been added to the model. |
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
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
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
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
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
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
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.