@orbat-mapper/tactical-draw 0.2.0-alpha.0 → 0.2.0-alpha.2
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/README.md +12 -12
- package/dist/index.mjs +14 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# @orbat-mapper/tactical-draw
|
|
2
2
|
|
|
3
|
-
The engine-agnostic draw/edit core for
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`EditPointerDriver` pointer contract, handle rendering, interaction styles, and
|
|
8
|
-
pick helpers.
|
|
3
|
+
The engine-agnostic draw/edit core for `@orbat-mapper` tactical graphics:
|
|
4
|
+
draw and edit controllers, sessions and draw rules, the `MapAdapter` contract
|
|
5
|
+
and base adapter, pixel-space hit-testing, handle rendering, interaction
|
|
6
|
+
styles, and pick helpers.
|
|
9
7
|
|
|
10
|
-
It depends
|
|
11
|
-
concrete map engine
|
|
12
|
-
|
|
8
|
+
It only depends on `@orbat-mapper/control-measures` and `geojson`, with no
|
|
9
|
+
concrete map engine in sight. Bring your own: pair this package with one of
|
|
10
|
+
the engine adapters, or implement `MapAdapter` against whatever you're
|
|
11
|
+
already using.
|
|
13
12
|
|
|
14
13
|
## Installation
|
|
15
14
|
|
|
@@ -86,9 +85,10 @@ if (session && "canCommit" in session) {
|
|
|
86
85
|
|
|
87
86
|
## Bring your own engine
|
|
88
87
|
|
|
89
|
-
Implement `MapAdapter` (or extend `BaseMapAdapter`) against your map engine
|
|
90
|
-
hand it to `TacticalDraw`.
|
|
91
|
-
|
|
88
|
+
Implement `MapAdapter` (or extend `BaseMapAdapter`) against your map engine
|
|
89
|
+
and hand it to `TacticalDraw`. The controllers, sessions, gestures, and
|
|
90
|
+
handle rendering above the adapter don't need to know or care which engine
|
|
91
|
+
is underneath.
|
|
92
92
|
|
|
93
93
|
## License
|
|
94
94
|
|
package/dist/index.mjs
CHANGED
|
@@ -511,6 +511,18 @@ function combineWithHostSignal(hostSignal) {
|
|
|
511
511
|
* is one entry here (ADR-0020).
|
|
512
512
|
*/
|
|
513
513
|
const PIXEL_SIZE_OPTIONS = {
|
|
514
|
+
boundary: {
|
|
515
|
+
pixels: "echelonSizePixels",
|
|
516
|
+
meters: "echelonSize"
|
|
517
|
+
},
|
|
518
|
+
"battle-position": {
|
|
519
|
+
pixels: "echelonSizePixels",
|
|
520
|
+
meters: "echelonSize"
|
|
521
|
+
},
|
|
522
|
+
"strong-point": {
|
|
523
|
+
pixels: "echelonSizePixels",
|
|
524
|
+
meters: "echelonSize"
|
|
525
|
+
},
|
|
514
526
|
flot: {
|
|
515
527
|
pixels: "radiusPixels",
|
|
516
528
|
meters: "radius"
|
|
@@ -1148,14 +1160,14 @@ function runVariableLengthDraw(options) {
|
|
|
1148
1160
|
renderPreview();
|
|
1149
1161
|
}
|
|
1150
1162
|
function buildSnapshot() {
|
|
1151
|
-
const built = {
|
|
1163
|
+
const built = withCommittedAdapterMeasureOptions({
|
|
1152
1164
|
id: generateId(),
|
|
1153
1165
|
kind,
|
|
1154
1166
|
controlPoints: committed.map((p) => [...p]),
|
|
1155
1167
|
...measureOptions !== void 0 ? { options: measureOptions } : {},
|
|
1156
1168
|
...measureStyle !== void 0 ? { style: measureStyle } : {},
|
|
1157
1169
|
...measureProperties !== void 0 ? { properties: measureProperties } : {}
|
|
1158
|
-
};
|
|
1170
|
+
}, adapter);
|
|
1159
1171
|
const measure = sizeAnchor === "screen" ? built : bakePixelSizeToGround(built, adapter);
|
|
1160
1172
|
return {
|
|
1161
1173
|
measure: cloneControlMeasure(measure),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orbat-mapper/tactical-draw",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.2",
|
|
4
4
|
"description": "Engine-agnostic draw/edit core for tactical control measures (MIL-STD-2525 / APP-6). The MapAdapter ABI and bring-your-own-engine entry point for the tactical-draw package family.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Orbat Mapper",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@orbat-mapper/control-measures": "^0.2.0-alpha.
|
|
41
|
+
"@orbat-mapper/control-measures": "^0.2.0-alpha.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@arethetypeswrong/core": "^0.18.3",
|