@vcmap/viewshed 3.0.5 → 4.1.0

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 CHANGED
@@ -1,3 +1,13 @@
1
+ # v4.1.0
2
+
3
+ - Added `ActivateViewshedCallback` and `DeactivateViewshedCallback` to activate and deactivate the Viewshed tool via the VcsCallback system
4
+
5
+ # v4.0.0
6
+
7
+ - updates @vcmap/core and @vcmap/ui to 6.3
8
+ - refactor plugin code to TypeScript
9
+ - makes parameters editable with an inputfield
10
+
1
11
  # v3.0.4
2
12
 
3
13
  - fixes bug where setting a single tool in the configuration file would fail
package/README.md CHANGED
@@ -17,3 +17,52 @@ To add and configure the plugin add an entry with name @vcmap/viewshed to the ma
17
17
  | tools | `Array<'cone' \| '360'>` | `['cone', '360']` | The tools/modes that should be added to the map. |
18
18
  | shadowColor | `string` | `#3333331A` | The color of areas that **can not** be seen from the "viewers" position |
19
19
  | visibleColor | `string` | `FF990080` | The color of areas that **can** be seen from the "viewers" position |
20
+
21
+ ## Callbacks
22
+
23
+ The Viewshed plugin registers two [VcsCallbacks](https://github.com/virtualcitySYSTEMS/map-ui/blob/main/documentation/CALLBACKS.md) that can be used in guided tours, splash screens, or any other callback-driven feature.
24
+
25
+ ### ActivateViewshedCallback
26
+
27
+ Activates the Viewshed plugin and optionally sets the mode and viewshed to display.
28
+
29
+ | property | type | description |
30
+ | --------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
31
+ | m | `'create' \| 'view' \| 'edit' \| 'move'` | The mode to activate the plugin in. Defaults to `create`, which starts the map interaction for placing a viewshed. |
32
+ | cv | `ViewshedOptions` | Optional viewshed to display. Required for `view` and `edit` modes. |
33
+ | cv.viewshedType | `'cone' \| '360'` | The type of viewshed to use. |
34
+ | cv.position | `[number, number, number]` | Position of the viewshed in WGS84 coordinates `[longitude, latitude, height]`. |
35
+ | cv.orientation | `{ heading, pitch, roll }` | Heading, pitch and roll of the viewshed, in radians (cone type only). |
36
+ | cv.heightOffset | `number` | Height offset added to the Z value of the position. |
37
+
38
+ Minimal example — opens the create interaction for a cone viewshed:
39
+
40
+ ```json
41
+ {
42
+ "type": "ActivateViewshedCallback"
43
+ }
44
+ ```
45
+
46
+ A full example displaying an existing viewshed in edit mode:
47
+
48
+ ```json
49
+ {
50
+ "type": "ActivateViewshedCallback",
51
+ "m": "edit",
52
+ "cv": {
53
+ "viewshedType": "cone",
54
+ "position": [13.4, 52.5, 50],
55
+ "orientation": { "heading": 0.78, "pitch": -0.17, "roll": 0 }
56
+ }
57
+ }
58
+ ```
59
+
60
+ ### DeactivateViewshedCallback
61
+
62
+ Deactivates the Viewshed tool.
63
+
64
+ ```json
65
+ {
66
+ "type": "DeactivateViewshedCallback"
67
+ }
68
+ ```