@orbat-mapper/tactical-draw 0.35.0 → 0.36.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/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as CollocationLocate, $t as DEFAULT_PIN_PRESENTATION, A as PointSymbolColors, At as validateCollocation, B as clonePointSymbol, Bt as isMarker, C as isMinePattern, Ct as collocationOpacity, D as PointSymbol, Dt as resolveCollocationLocation, E as OffsetDragModifier, Et as patchCollocationOptions, F as PointSymbolPlacement, Ft as MarkerRender, G as Collocation, Gt as EditModifiers, H as resizePointSymbolSize, Ht as normalizeMarker, I as PointSymbolRect, It as MarkerSize, J as CollocationBracketShape, Jt as ResolvedEditModifiers, K as CollocationAreaStyle, Kt as ModifierKey, L as PointSymbolRender, Lt as MarkerStyle, M as PointSymbolGraphicModifiers, Mt as MarkerAnchor, N as PointSymbolOffset, Nt as MarkerCapability, O as PointSymbolAnchor, Ot as resolveCollocationSize, P as PointSymbolOffsetStyle, Pt as MarkerIcon, Q as CollocationHalo, Qt as PointerEventInfo, R as PointSymbolSize, Rt as cloneMarker, S as fillPatternImageId, St as collocationMemberPart, T as parseColor, Tt as normalizeCollocation, U as BuildCollocationRenderOptions, Ut as validateMarker, V as isPointSymbol, Vt as markerOpacity, W as COLLOCATION_SCREEN_RELATIVE_REACH, Wt as DEFAULT_EDIT_MODIFIERS, X as CollocationCommitChanges, Xt as EditPointerDriver, Y as CollocationBracketSide, Yt as readPickModifiers, Z as CollocationGround, Zt as PointerCallback, _ as HATCH_PATTERNS, _t as CollocationStroke, a as ImageOverlayResource, an as PinPresentationState, at as CollocationMemberOptionTypes, b as Rgba, bt as buildCollocationRender, c as MapCursor, cn as PinPresentationStore, ct as CollocationMemberRenderContext, d as PickEvent, dn as isValidPinNumber, dt as CollocationPart, en as PinFootprint, et as CollocationMarker, f as PickHandler, fn as pinDistanceScale, ft as CollocationPartDrag, g as TextStyleOptions, gt as CollocationRenderMember, h as StyleOptions, ht as CollocationRender, i as IconResource, in as PinPresentationPatch, it as CollocationMemberIcon, j as PointSymbolConnector, jt as Marker, k as PointSymbolCapability, kt as stableCollocation, l as MapEvent, ln as PinRender, lt as CollocationMemberSupport, m as PixelCoordinate, mn as resolvePinPresentation, mt as CollocationPointSymbol, n as HandleStyle, nn as PinPresentation, nt as CollocationMemberCapabilities, o as LayerId, on as PinPresentationStatus, ot as CollocationMemberOptions, p as PickOptions, pn as pinZoomScale, pt as CollocationPlate, q as CollocationBracketPlacement, qt as PickModifiers, r as IconHitLine, rn as PinPresentationCapability, rt as CollocationMemberGraphic, s as MapAdapter, sn as PinPresentationStatusEvent, st as CollocationMemberRender, t as FeatureGroup, tn as PinOverridePatch, tt as CollocationMember, u as MapEventHandler, un as combinePinScale, ut as CollocationOptions, v as HatchPattern, vt as CollocationStyle, w as makeFillPatternImage, wt as isCollocation, x as fillPatternImageDimension, xt as cloneCollocation, y as MINE_PATTERN_TILE_SIZE, yt as ResolvedCollocationMemberRender, z as PointSymbolStyle, zt as composeMarkerCapabilities } from "./map-adapter-De1DC6Zy.mjs";
1
+ import { $ as CollocationLocate, $t as DEFAULT_PIN_PRESENTATION, A as PointSymbolColors, At as validateCollocation, B as clonePointSymbol, Bt as isMarker, C as isMinePattern, Ct as collocationOpacity, D as PointSymbol, Dt as resolveCollocationLocation, E as OffsetDragModifier, Et as patchCollocationOptions, F as PointSymbolPlacement, Ft as MarkerRender, G as Collocation, Gt as EditModifiers, H as resizePointSymbolSize, Ht as normalizeMarker, I as PointSymbolRect, It as MarkerSize, J as CollocationBracketShape, Jt as ResolvedEditModifiers, K as CollocationAreaStyle, Kt as ModifierKey, L as PointSymbolRender, Lt as MarkerStyle, M as PointSymbolGraphicModifiers, Mt as MarkerAnchor, N as PointSymbolOffset, Nt as MarkerCapability, O as PointSymbolAnchor, Ot as resolveCollocationSize, P as PointSymbolOffsetStyle, Pt as MarkerIcon, Q as CollocationHalo, Qt as PointerEventInfo, R as PointSymbolSize, Rt as cloneMarker, S as fillPatternImageId, St as collocationMemberPart, T as parseColor, Tt as normalizeCollocation, U as BuildCollocationRenderOptions, Ut as validateMarker, V as isPointSymbol, Vt as markerOpacity, W as COLLOCATION_SCREEN_RELATIVE_REACH, Wt as DEFAULT_EDIT_MODIFIERS, X as CollocationCommitChanges, Xt as EditPointerDriver, Y as CollocationBracketSide, Yt as readPickModifiers, Z as CollocationGround, Zt as PointerCallback, _ as HATCH_PATTERNS, _t as CollocationStroke, a as ImageOverlayResource, an as PinPresentationState, at as CollocationMemberOptionTypes, b as Rgba, bt as buildCollocationRender, c as MapCursor, cn as PinPresentationStore, ct as CollocationMemberRenderContext, d as PickEvent, dn as isValidPinNumber, dt as CollocationPart, en as PinFootprint, et as CollocationMarker, f as PickHandler, fn as pinDistanceScale, ft as CollocationPartDrag, g as TextStyleOptions, gt as CollocationRenderMember, h as StyleOptions, ht as CollocationRender, i as IconResource, in as PinPresentationPatch, it as CollocationMemberIcon, j as PointSymbolConnector, jt as Marker, k as PointSymbolCapability, kt as stableCollocation, l as MapEvent, ln as PinRender, lt as CollocationMemberSupport, m as PixelCoordinate, mn as resolvePinPresentation, mt as CollocationPointSymbol, n as HandleStyle, nn as PinPresentation, nt as CollocationMemberCapabilities, o as LayerId, on as PinPresentationStatus, ot as CollocationMemberOptions, p as PickOptions, pn as pinZoomScale, pt as CollocationPlate, q as CollocationBracketPlacement, qt as PickModifiers, r as IconHitLine, rn as PinPresentationCapability, rt as CollocationMemberGraphic, s as MapAdapter, sn as PinPresentationStatusEvent, st as CollocationMemberRender, t as FeatureGroup, tn as PinOverridePatch, tt as CollocationMember, u as MapEventHandler, un as combinePinScale, ut as CollocationOptions, v as HatchPattern, vt as CollocationStyle, w as makeFillPatternImage, wt as isCollocation, x as fillPatternImageDimension, xt as cloneCollocation, y as MINE_PATTERN_TILE_SIZE, yt as ResolvedCollocationMemberRender, z as PointSymbolStyle, zt as composeMarkerCapabilities } from "./map-adapter-CTbZTAL0.mjs";
2
2
  import { AmplifierPlacement, AmplifierPlacements, ControlMeasure, ControlMeasureKind, ControlMeasureRender, ControlMeasureStyle, HighlightAppearance, LabelFit, SymbolColors, TextAmplifiers } from "@orbat-mapper/control-measures";
3
3
  import { Feature, Position } from "geojson";
4
4
 
@@ -942,7 +942,8 @@ interface ResolvedCollocationOptions {
942
942
  mark: MemberMark | "none";
943
943
  color: string;
944
944
  size: number;
945
- };
945
+ }; /** The location and member position marks shrink with the collocation scale. */
946
+ scaleMarks: boolean;
946
947
  ties: ResolvedCollocationStroke & {
947
948
  show: boolean;
948
949
  };
@@ -1115,7 +1116,10 @@ interface CollocationGroundMark<M extends string> {
1115
1116
  position: Position;
1116
1117
  mark: M;
1117
1118
  color: string;
1118
- /** Diameter in CSS px, shrinking with the collocation scale. */
1119
+ /**
1120
+ * Diameter in CSS px, shrinking with the collocation scale unless
1121
+ * `ground.scaleMarks` is `false`.
1122
+ */
1119
1123
  size: number;
1120
1124
  /** Stroke width of rings and crosses: `line.strokeWidth`, scaled like {@link size}. */
1121
1125
  strokeWidth: number;
package/dist/index.mjs CHANGED
@@ -3378,6 +3378,7 @@ const COLLOCATION_OPTIONS_SCHEMA = {
3378
3378
  color: color$1,
3379
3379
  size: positive$1
3380
3380
  } },
3381
+ scaleMarks: boolean,
3381
3382
  ties: stroke(positive$1),
3382
3383
  spread: { fields: {
3383
3384
  shape: oneOf$1("none", "hull", "concave", "circle", "box"),
@@ -14260,6 +14261,7 @@ function resolveCollocationOptions(options = {}) {
14260
14261
  color: memberColor,
14261
14262
  size: positive(ground.memberPositions?.size, memberMark === "none" ? 0 : MARK_SIZES[memberMark])
14262
14263
  },
14264
+ scaleMarks: ground.scaleMarks !== false,
14263
14265
  ties: {
14264
14266
  show: ties.show === true,
14265
14267
  strokeColor: color(ties.strokeColor, memberColor),
@@ -14930,7 +14932,8 @@ function layoutCollocation(collocationRender, resolution) {
14930
14932
  }
14931
14933
  /**
14932
14934
  * `marked`: a Staff foot or leader already ends at the location, so `"auto"`
14933
- * draws no mark. The marks shrink with the collocation scale `s`.
14935
+ * draws no mark. The marks shrink with the collocation scale `s` unless
14936
+ * `ground.scaleMarks` is `false`.
14934
14937
  */
14935
14938
  function groundMarks(collocation, o, location, marked, s) {
14936
14939
  const positioned = collocation.members.flatMap((member) => {
@@ -14942,13 +14945,14 @@ function groundMarks(collocation, o, location, marked, s) {
14942
14945
  position: [nearestWorldCopyLng(position[0], location[0]), position[1]]
14943
14946
  }];
14944
14947
  });
14945
- /** A mark `size` px across at full size, shrunk with the collocation. */
14948
+ const k = o.ground.scaleMarks ? s : 1;
14949
+ /** A mark `size` px across at full size, shrunk with the collocation unless kept at full size. */
14946
14950
  const scaledMark = (mark, color, size) => ({
14947
14951
  mark,
14948
14952
  color,
14949
- size: size * s,
14950
- strokeWidth: o.line.strokeWidth * s,
14951
- paths: markPaths(mark, size * s)
14953
+ size: size * k,
14954
+ strokeWidth: o.line.strokeWidth * k,
14955
+ paths: markPaths(mark, size * k)
14952
14956
  });
14953
14957
  const markOptions = o.ground.memberPositions;
14954
14958
  const ties = [];
@@ -15234,10 +15238,12 @@ function renderCollocationGroup(collocation, capabilities, options) {
15234
15238
  * A ground mark, laid out at its full size times the collocation scale: its
15235
15239
  * image is drawn at full size and the engine scales it, natively for a
15236
15240
  * ground size, so zooming mints no new image and its Highlight casing
15237
- * shrinks with it.
15241
+ * shrinks with it. Under `ground.scaleMarks: false` it is laid out, and
15242
+ * drawn, at its full size.
15238
15243
  */
15244
+ const scaleMarks = layout.options.ground.scaleMarks;
15239
15245
  const markFeature = (featureId, mark, highlighted) => {
15240
- const k = layout.scale;
15246
+ const k = scaleMarks ? layout.scale : 1;
15241
15247
  let full = mark;
15242
15248
  if (k !== 1) {
15243
15249
  const size = snap(mark.size / k);
@@ -15259,7 +15265,7 @@ function renderCollocationGroup(collocation, capabilities, options) {
15259
15265
  iconId: addResource(markResource(full, highlighted ? highlight : void 0)),
15260
15266
  iconScale: k,
15261
15267
  [ICON_SCREEN_ROTATION_PROPERTY]: 0,
15262
- ...native ? groundSizeProperties(native, native.maxPixels) : {}
15268
+ ...native && scaleMarks ? groundSizeProperties(native, native.maxPixels) : {}
15263
15269
  })
15264
15270
  };
15265
15271
  };
@@ -440,6 +440,12 @@ interface CollocationGround {
440
440
  color?: string;
441
441
  size?: number;
442
442
  };
443
+ /**
444
+ * Default `true`: the location and member position marks shrink with the
445
+ * members when a ground size shrinks the collocation below its `maxPixels`.
446
+ * `false` keeps them at their full size.
447
+ */
448
+ scaleMarks?: boolean;
443
449
  /**
444
450
  * Lines from each positioned member to the location. Hidden by default;
445
451
  * `{ show: true }` is 1 px solid in `memberPositions.color`.
@@ -1,4 +1,4 @@
1
- import { m as PixelCoordinate, o as LayerId, s as MapAdapter } from "./map-adapter-De1DC6Zy.mjs";
1
+ import { m as PixelCoordinate, o as LayerId, s as MapAdapter } from "./map-adapter-CTbZTAL0.mjs";
2
2
  import { Feature } from "geojson";
3
3
 
4
4
  //#region src/testing/feature-group-conformance.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbat-mapper/tactical-draw",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
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",