@orbat-mapper/tactical-draw 0.2.0-alpha.5 → 0.2.0-alpha.6
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/dist/index.d.mts +15 -1
- package/dist/index.mjs +25 -7
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1171,4 +1171,18 @@ interface TransformBox {
|
|
|
1171
1171
|
angle: number;
|
|
1172
1172
|
}
|
|
1173
1173
|
//#endregion
|
|
1174
|
-
|
|
1174
|
+
//#region src/world-wrap.d.ts
|
|
1175
|
+
/**
|
|
1176
|
+
* Shift `lng` by whole world widths (360°) onto the copy nearest `refLng`.
|
|
1177
|
+
*
|
|
1178
|
+
* Map engines that wrap pointer longitudes into [-180, 180] (OpenLayers'
|
|
1179
|
+
* `toLonLat`, MapLibre's globe unproject) make positions jump ~360° when a
|
|
1180
|
+
* gesture crosses the antimeridian. Adapters use this to keep delivered
|
|
1181
|
+
* longitudes continuous with the view center, and to project coordinates on
|
|
1182
|
+
* the world copy the view is actually looking at.
|
|
1183
|
+
*/
|
|
1184
|
+
declare function nearestWorldCopyLng(lng: number, refLng: number): number;
|
|
1185
|
+
/** `nearestWorldCopyLng` applied to a lon/lat position. */
|
|
1186
|
+
declare function nearestWorldCopyPosition(position: Position, refLng: number): Position;
|
|
1187
|
+
//#endregion
|
|
1188
|
+
export { BaseMapAdapter, type CombinedAbort, type DrawMeasureDraft, type DrawOptions, type DrawSession, type EditChangeEvent, type EditManyOptions, type EditMode, type EditOptions, type EditPointerDriver, type EditSession, type FeatureOps, type GuideStyle, type HandleStyle, type InteractionStyle, type LayerId, type MapAdapter, type MapCursor, type MapEvent, type MapEventHandler, type NativeEventEntry, type PickEvent, type PickHandler, type PickOptions, type PixelCoordinate, type PointerCallback, PointerCallbackHub, type PointerEventInfo, type SizeAnchor, type StyleOptions, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, type TacticalDrawAbortReason, TacticalDrawDestroyedError, type TacticalDrawLayerOptions, type TacticalDrawOptions, type TextStyleOptions, type ToPixel, type TransformBox, type TransformChangeEvent, type TransformSession, bindAbortable, coerceHandleStyle, combineWithHostSignal, getSizeAnchor, hitTestFeature, ignoreAbort, isTacticalDrawAbortError, nearestWorldCopyLng, nearestWorldCopyPosition, pickHitTolerance, tryControlMeasureIdFromFeature };
|
package/dist/index.mjs
CHANGED
|
@@ -3808,10 +3808,9 @@ const BUILT_IN_GRAPHICS_STYLE = {
|
|
|
3808
3808
|
};
|
|
3809
3809
|
/**
|
|
3810
3810
|
* Built-in defaults for the interaction-affordance slots (ADR-0006, extended
|
|
3811
|
-
* for the ADR-0017 transform box). The scale (corner) grips
|
|
3812
|
-
* with the same blue stroke as the box outline, so the
|
|
3813
|
-
*
|
|
3814
|
-
* doesn't get mistaken for a corner. Vertex/midpoint keep their existing
|
|
3811
|
+
* for the ADR-0017 transform box). The scale (corner) grips and the rotate
|
|
3812
|
+
* grip are white-filled with the same blue stroke as the box outline, so the
|
|
3813
|
+
* box reads as one coherent affordance. Vertex/midpoint keep their existing
|
|
3815
3814
|
* white/gray family.
|
|
3816
3815
|
*/
|
|
3817
3816
|
const BUILT_IN_INTERACTION_STYLE = {
|
|
@@ -3844,8 +3843,9 @@ const BUILT_IN_INTERACTION_STYLE = {
|
|
|
3844
3843
|
},
|
|
3845
3844
|
rotateHandle: {
|
|
3846
3845
|
pointRadius: 5,
|
|
3847
|
-
fillColor: "#
|
|
3848
|
-
strokeColor: "#
|
|
3846
|
+
fillColor: "#ffffff",
|
|
3847
|
+
strokeColor: "#4f7cff",
|
|
3848
|
+
strokeWidth: 2
|
|
3849
3849
|
}
|
|
3850
3850
|
};
|
|
3851
3851
|
const HANDLE_SLOTS = [
|
|
@@ -3896,4 +3896,22 @@ function resolveSlot(adapter, supplied, owned) {
|
|
|
3896
3896
|
return id;
|
|
3897
3897
|
}
|
|
3898
3898
|
//#endregion
|
|
3899
|
-
|
|
3899
|
+
//#region src/world-wrap.ts
|
|
3900
|
+
/**
|
|
3901
|
+
* Shift `lng` by whole world widths (360°) onto the copy nearest `refLng`.
|
|
3902
|
+
*
|
|
3903
|
+
* Map engines that wrap pointer longitudes into [-180, 180] (OpenLayers'
|
|
3904
|
+
* `toLonLat`, MapLibre's globe unproject) make positions jump ~360° when a
|
|
3905
|
+
* gesture crosses the antimeridian. Adapters use this to keep delivered
|
|
3906
|
+
* longitudes continuous with the view center, and to project coordinates on
|
|
3907
|
+
* the world copy the view is actually looking at.
|
|
3908
|
+
*/
|
|
3909
|
+
function nearestWorldCopyLng(lng, refLng) {
|
|
3910
|
+
return lng + 360 * Math.round((refLng - lng) / 360);
|
|
3911
|
+
}
|
|
3912
|
+
/** `nearestWorldCopyLng` applied to a lon/lat position. */
|
|
3913
|
+
function nearestWorldCopyPosition(position, refLng) {
|
|
3914
|
+
return [nearestWorldCopyLng(position[0], refLng), ...position.slice(1)];
|
|
3915
|
+
}
|
|
3916
|
+
//#endregion
|
|
3917
|
+
export { BaseMapAdapter, PointerCallbackHub, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, TacticalDrawDestroyedError, bindAbortable, coerceHandleStyle, combineWithHostSignal, getSizeAnchor, hitTestFeature, ignoreAbort, isTacticalDrawAbortError, nearestWorldCopyLng, nearestWorldCopyPosition, pickHitTolerance, tryControlMeasureIdFromFeature };
|
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.6",
|
|
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.7"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@arethetypeswrong/core": "^0.18.3",
|