@orbat-mapper/tactical-draw 0.2.0-alpha.0 → 0.2.0-alpha.1
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 +10 -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,14 @@ 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
|
+
},
|
|
514
522
|
flot: {
|
|
515
523
|
pixels: "radiusPixels",
|
|
516
524
|
meters: "radius"
|
|
@@ -1148,14 +1156,14 @@ function runVariableLengthDraw(options) {
|
|
|
1148
1156
|
renderPreview();
|
|
1149
1157
|
}
|
|
1150
1158
|
function buildSnapshot() {
|
|
1151
|
-
const built = {
|
|
1159
|
+
const built = withCommittedAdapterMeasureOptions({
|
|
1152
1160
|
id: generateId(),
|
|
1153
1161
|
kind,
|
|
1154
1162
|
controlPoints: committed.map((p) => [...p]),
|
|
1155
1163
|
...measureOptions !== void 0 ? { options: measureOptions } : {},
|
|
1156
1164
|
...measureStyle !== void 0 ? { style: measureStyle } : {},
|
|
1157
1165
|
...measureProperties !== void 0 ? { properties: measureProperties } : {}
|
|
1158
|
-
};
|
|
1166
|
+
}, adapter);
|
|
1159
1167
|
const measure = sizeAnchor === "screen" ? built : bakePixelSizeToGround(built, adapter);
|
|
1160
1168
|
return {
|
|
1161
1169
|
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.1",
|
|
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.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@arethetypeswrong/core": "^0.18.3",
|