@orbat-mapper/tactical-draw 0.33.0 → 0.34.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 +42 -1
- package/dist/index.mjs +68 -16
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1446,6 +1446,18 @@ interface TransformSession {
|
|
|
1446
1446
|
* members are unaffected.
|
|
1447
1447
|
*/
|
|
1448
1448
|
setSizeAnchor(anchor: SizeAnchor): void;
|
|
1449
|
+
/**
|
|
1450
|
+
* Whether each member is outlined inside the group box. Initialised from
|
|
1451
|
+
* `EditManyOptions.memberOutlines` (default `true`) and mutated by
|
|
1452
|
+
* [[setMemberOutlines]].
|
|
1453
|
+
*/
|
|
1454
|
+
readonly memberOutlines: boolean;
|
|
1455
|
+
/**
|
|
1456
|
+
* Show or hide the per-member outlines inside the group box, leaving the box
|
|
1457
|
+
* and its handles as they are. A host turns them off when the members read
|
|
1458
|
+
* as one object (a group selected whole) rather than as separate picks.
|
|
1459
|
+
*/
|
|
1460
|
+
setMemberOutlines(visible: boolean): void;
|
|
1449
1461
|
/**
|
|
1450
1462
|
* Replace the member set in place — the primitive behind shift-click toggle,
|
|
1451
1463
|
* marquee replace, and single-edit → group folding, without tearing the
|
|
@@ -1981,6 +1993,22 @@ interface EditManyOptions {
|
|
|
1981
1993
|
interactionStyle?: InteractionStyle;
|
|
1982
1994
|
/** Size anchor for ordinary control measures in the group. Uniform symbols retain their own unit. Default `"ground"`. */
|
|
1983
1995
|
sizeAnchor?: SizeAnchor;
|
|
1996
|
+
/**
|
|
1997
|
+
* Whether each member gets its own outline inside the group box. Default
|
|
1998
|
+
* `true`; see `TransformSession.setMemberOutlines`. On
|
|
1999
|
+
* {@link TacticalDraw.syncTransformGraphics} it also applies to a live
|
|
2000
|
+
* session, where the other options are ignored.
|
|
2001
|
+
*/
|
|
2002
|
+
memberOutlines?: boolean;
|
|
2003
|
+
}
|
|
2004
|
+
/**
|
|
2005
|
+
* A host-defined set of graphics outlined together as one passive box
|
|
2006
|
+
* ({@link TacticalDraw.setHighlightedGroups}), such as a group the pointer is
|
|
2007
|
+
* over. `id` keys the outline; `graphicIds` are the graphics it encloses.
|
|
2008
|
+
*/
|
|
2009
|
+
interface HighlightedGroup {
|
|
2010
|
+
id: string;
|
|
2011
|
+
graphicIds: readonly string[];
|
|
1984
2012
|
}
|
|
1985
2013
|
/**
|
|
1986
2014
|
* Draft control measure handed to `TacticalDraw.draw`. `kind` is required up
|
|
@@ -2161,6 +2189,8 @@ declare class TacticalDraw {
|
|
|
2161
2189
|
* `render()` so outlines track geometry, style, and dropped graphics.
|
|
2162
2190
|
*/
|
|
2163
2191
|
private highlightedIds;
|
|
2192
|
+
/** Graphic sets outlined as one box each ({@link setHighlightedGroups}). */
|
|
2193
|
+
private highlightedGroups;
|
|
2164
2194
|
private pinBodies;
|
|
2165
2195
|
/** Resolved marker icons, so pin, highlight and view rebuilds don't re-ask the host. */
|
|
2166
2196
|
private markerRenders;
|
|
@@ -2343,6 +2373,17 @@ declare class TacticalDraw {
|
|
|
2343
2373
|
* "locked selection" chrome.
|
|
2344
2374
|
*/
|
|
2345
2375
|
setHighlightedGraphics(ids: readonly string[]): void;
|
|
2376
|
+
/**
|
|
2377
|
+
* Replace the passive group outlines with `groups`: one outline box around
|
|
2378
|
+
* the joint bounds of each group's still-rendered graphics, drawn with the
|
|
2379
|
+
* same style and on the same layer as {@link setHighlightedGraphics}, which
|
|
2380
|
+
* it sits beside. Declarative like that set: `[]` clears every group
|
|
2381
|
+
* outline. A graphic in an active edit or transform session still counts
|
|
2382
|
+
* toward its group's bounds (at its last rendered geometry), so a host can
|
|
2383
|
+
* frame the group around a member being edited on its own. A group with no
|
|
2384
|
+
* rendered graphic draws nothing.
|
|
2385
|
+
*/
|
|
2386
|
+
setHighlightedGroups(groups: readonly HighlightedGroup[]): void;
|
|
2346
2387
|
/**
|
|
2347
2388
|
* Cancel any pending coalesced highlight frame and re-project highlights
|
|
2348
2389
|
* immediately. Used by every caller other than `setHighlightedGraphics`
|
|
@@ -2813,4 +2854,4 @@ declare function nearestWorldCopyLng(lng: number, refLng: number): number;
|
|
|
2813
2854
|
/** `nearestWorldCopyLng` applied to a lon/lat position. */
|
|
2814
2855
|
declare function nearestWorldCopyPosition(position: Position, refLng: number): Position;
|
|
2815
2856
|
//#endregion
|
|
2816
|
-
export { type AnchoredGraphic, BaseMapAdapter, type CombinedAbort, DEFAULT_EDIT_MODIFIERS, DEFAULT_LABEL_SIZE_PIXELS, DEFAULT_MARKER_SIZE, DEFAULT_PIN_PRESENTATION, DEFAULT_TEXT_SIZE_MAX_PIXELS, DEFAULT_TEXT_SIZE_MIN_PIXELS, type DeferredSnapProvider, type DrawImageDraft, type DrawMarkerDraft, type DrawMeasureDraft, type DrawNoteDraft, type DrawOptions, type DrawPointSymbolDraft, type DrawSession, type EditChangeEvent, type EditManyOptions, type EditMode, type EditModifiers, type EditOptions, type EditPointerDriver, type EditSession, type FeatureGroup, type FeatureHighlightBand, type Graphic, type GraphicEditChangeEvent, type GraphicEditSession, type GraphicGeometrySnappingOptions, type GraphicRender, type GraphicSnapshot, type GuideStyle, HATCH_PATTERNS, HIGHLIGHT_BAND_SLOTS, HIGHLIGHT_CASING_OUTSET_CSS_PIXELS, HIGHLIGHT_GLOW_BANDS, type HandleStyle, type HatchPattern, type HighlightBand, type HighlightBandSlot, type HighlightCasing, type IconResource, type ImageCapability, ImageCapabilityRequiredError, type ImageFootprint, type ImageGraphic, type ImageGraphicStyle, type ImageIntrinsicSize, type ImageOverlayResource, type ImageRender, type ImageResource, type ImageSize, type InteractionHit, type InteractionStyle, type LabelExtent, type LabelSizeBand, type LayerId, MINE_PATTERN_TILE_SIZE, type MapAdapter, type MapCursor, type MapEvent, type MapEventHandler, type Marker, type MarkerAnchor, type MarkerCapability, MarkerCapabilityRequiredError, type MarkerFootprint, type MarkerIcon, type MarkerRender, type MarkerSize, type MarkerStyle, type MergedPickFeature, type ModifierKey, NOTE_MAX_RASTER_PIXELS, NOTE_MAX_WIDTH, NOTE_MIN_WIDTH, type NativeEventEntry, type NoteBodyAlign, type NoteBodyStyle, type NoteCapability, NoteCapabilityRequiredError, type NoteEmSize, type NoteFadeThresholds, type NoteFontRoles, type NoteFootprint, type NoteFrame, type NoteFramePresetId, type NoteFrameTokenOverrides, type NoteGraphic, type NoteGraphicStyle, type NoteHeadingAlign, type NoteRaster, type NoteRender, type NoteStroke, type OffsetDragModifier, type PickCandidate, type PickCandidateHit, type PickCandidateHitKind, type PickCandidateInput, type PickEvaluationContext, type PickEvent, type PickHandler, type PickOptions, type PickPointerType, PinFootprint, PinOverridePatch, PinPresentation, PinPresentationCapability, PinPresentationPatch, PinPresentationState, PinPresentationStatus, PinPresentationStatusEvent, PinPresentationStore, PinRender, type PinnableGraphic, type PixelCoordinate, type PointSymbol, type PointSymbolAnchor, type PointSymbolCapability, PointSymbolCapabilityRequiredError, type PointSymbolColors, type PointSymbolConnector, type PointSymbolFootprint, type PointSymbolGraphicModifiers, type PointSymbolOffset, type PointSymbolOffsetControls, type PointSymbolOffsetLayout, type PointSymbolOffsetStyle, type PointSymbolPlacement, type PointSymbolProjection, type PointSymbolRect, type PointSymbolRender, type PointSymbolSize, type PointSymbolStyle, type PointSymbolView, type PointerCallback, PointerCallbackHub, type PointerEventInfo, type ResolvedEditModifiers, type ResolvedPickPresentation, type Rgba, type RotatedScreenBounds, type ScreenBounds, type SessionChangeSource, type SessionHistory, type SessionHistoryState, type SettleReason, type SizeAnchor, type SnapCandidate, type SnapCandidateProvider, type SnapCandidateRequest, type SnapInteraction, type SnapResult, type SnappingOptions, type StyleOptions, TEXT_FADE_END_RATIO, TEXT_HALO_BREAKPOINT_PIXELS, TEXT_HALO_COLOR, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, type TacticalDrawAbortReason, TacticalDrawDestroyedError, type TacticalDrawLayerOptions, type TacticalDrawOptions, type TextAppearance, type TextSizeProps, type TextStyleOptions, type ToPixel, type TransformBox, type TransformChangeEvent, type TransformSession, type TransientChangeEvent, type TransientPhase, alignPointSymbolIndicator, bindAbortable, canResetGroundSizes, cloneImageGraphic, cloneMarker, cloneNoteGraphic, clonePointSymbol, coerceHandleStyle, combinePinScale, combineWithHostSignal, composeMarkerCapabilities, convertPointSymbolPlacement, effectivePointSymbolPixelSize, evaluatePickCandidates, fillPatternImageDimension, fillPatternImageId, getSizeAnchor, hasHighlightCasing, highlightBandsForStyle, highlightBandsInPaintOrder, highlightCasingWidth, hitTestFeature, hitTestIconFeature, ignoreAbort, imageFootprint, imageOpacity, isAnchoredGraphic, isImageGraphic, isMarker, isMinePattern, isNoteGraphic, isPinnableGraphic, isPointSymbol, isTacticalDrawAbortError, isValidPinNumber, makeFillPatternImage, markerFootprint, markerOpacity, mergeNativeAndCachedPickFeatures, movePointSymbolLocation, nearestWorldCopyLng, nearestWorldCopyPosition, normalizeImageGraphic, normalizeMarker, normalizeNoteGraphic, noteFootprint, noteOpacity, parseColor, pickHitTolerance, pickPointerType, pinDistanceScale, pinZoomScale, placePointSymbol, pointSymbolFootprint, pointSymbolResource, renderNoteForAdapter, renderOrderToVisualOrder, resetGroundSizeOptions, resizePointSymbolSize, resolveGroundTextSizePixels, resolveHighlightBands, resolveHighlightCasing, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker, validateNoteGraphic };
|
|
2857
|
+
export { type AnchoredGraphic, BaseMapAdapter, type CombinedAbort, DEFAULT_EDIT_MODIFIERS, DEFAULT_LABEL_SIZE_PIXELS, DEFAULT_MARKER_SIZE, DEFAULT_PIN_PRESENTATION, DEFAULT_TEXT_SIZE_MAX_PIXELS, DEFAULT_TEXT_SIZE_MIN_PIXELS, type DeferredSnapProvider, type DrawImageDraft, type DrawMarkerDraft, type DrawMeasureDraft, type DrawNoteDraft, type DrawOptions, type DrawPointSymbolDraft, type DrawSession, type EditChangeEvent, type EditManyOptions, type EditMode, type EditModifiers, type EditOptions, type EditPointerDriver, type EditSession, type FeatureGroup, type FeatureHighlightBand, type Graphic, type GraphicEditChangeEvent, type GraphicEditSession, type GraphicGeometrySnappingOptions, type GraphicRender, type GraphicSnapshot, type GuideStyle, HATCH_PATTERNS, HIGHLIGHT_BAND_SLOTS, HIGHLIGHT_CASING_OUTSET_CSS_PIXELS, HIGHLIGHT_GLOW_BANDS, type HandleStyle, type HatchPattern, type HighlightBand, type HighlightBandSlot, type HighlightCasing, type HighlightedGroup, type IconResource, type ImageCapability, ImageCapabilityRequiredError, type ImageFootprint, type ImageGraphic, type ImageGraphicStyle, type ImageIntrinsicSize, type ImageOverlayResource, type ImageRender, type ImageResource, type ImageSize, type InteractionHit, type InteractionStyle, type LabelExtent, type LabelSizeBand, type LayerId, MINE_PATTERN_TILE_SIZE, type MapAdapter, type MapCursor, type MapEvent, type MapEventHandler, type Marker, type MarkerAnchor, type MarkerCapability, MarkerCapabilityRequiredError, type MarkerFootprint, type MarkerIcon, type MarkerRender, type MarkerSize, type MarkerStyle, type MergedPickFeature, type ModifierKey, NOTE_MAX_RASTER_PIXELS, NOTE_MAX_WIDTH, NOTE_MIN_WIDTH, type NativeEventEntry, type NoteBodyAlign, type NoteBodyStyle, type NoteCapability, NoteCapabilityRequiredError, type NoteEmSize, type NoteFadeThresholds, type NoteFontRoles, type NoteFootprint, type NoteFrame, type NoteFramePresetId, type NoteFrameTokenOverrides, type NoteGraphic, type NoteGraphicStyle, type NoteHeadingAlign, type NoteRaster, type NoteRender, type NoteStroke, type OffsetDragModifier, type PickCandidate, type PickCandidateHit, type PickCandidateHitKind, type PickCandidateInput, type PickEvaluationContext, type PickEvent, type PickHandler, type PickOptions, type PickPointerType, PinFootprint, PinOverridePatch, PinPresentation, PinPresentationCapability, PinPresentationPatch, PinPresentationState, PinPresentationStatus, PinPresentationStatusEvent, PinPresentationStore, PinRender, type PinnableGraphic, type PixelCoordinate, type PointSymbol, type PointSymbolAnchor, type PointSymbolCapability, PointSymbolCapabilityRequiredError, type PointSymbolColors, type PointSymbolConnector, type PointSymbolFootprint, type PointSymbolGraphicModifiers, type PointSymbolOffset, type PointSymbolOffsetControls, type PointSymbolOffsetLayout, type PointSymbolOffsetStyle, type PointSymbolPlacement, type PointSymbolProjection, type PointSymbolRect, type PointSymbolRender, type PointSymbolSize, type PointSymbolStyle, type PointSymbolView, type PointerCallback, PointerCallbackHub, type PointerEventInfo, type ResolvedEditModifiers, type ResolvedPickPresentation, type Rgba, type RotatedScreenBounds, type ScreenBounds, type SessionChangeSource, type SessionHistory, type SessionHistoryState, type SettleReason, type SizeAnchor, type SnapCandidate, type SnapCandidateProvider, type SnapCandidateRequest, type SnapInteraction, type SnapResult, type SnappingOptions, type StyleOptions, TEXT_FADE_END_RATIO, TEXT_HALO_BREAKPOINT_PIXELS, TEXT_HALO_COLOR, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, type TacticalDrawAbortReason, TacticalDrawDestroyedError, type TacticalDrawLayerOptions, type TacticalDrawOptions, type TextAppearance, type TextSizeProps, type TextStyleOptions, type ToPixel, type TransformBox, type TransformChangeEvent, type TransformSession, type TransientChangeEvent, type TransientPhase, alignPointSymbolIndicator, bindAbortable, canResetGroundSizes, cloneImageGraphic, cloneMarker, cloneNoteGraphic, clonePointSymbol, coerceHandleStyle, combinePinScale, combineWithHostSignal, composeMarkerCapabilities, convertPointSymbolPlacement, effectivePointSymbolPixelSize, evaluatePickCandidates, fillPatternImageDimension, fillPatternImageId, getSizeAnchor, hasHighlightCasing, highlightBandsForStyle, highlightBandsInPaintOrder, highlightCasingWidth, hitTestFeature, hitTestIconFeature, ignoreAbort, imageFootprint, imageOpacity, isAnchoredGraphic, isImageGraphic, isMarker, isMinePattern, isNoteGraphic, isPinnableGraphic, isPointSymbol, isTacticalDrawAbortError, isValidPinNumber, makeFillPatternImage, markerFootprint, markerOpacity, mergeNativeAndCachedPickFeatures, movePointSymbolLocation, nearestWorldCopyLng, nearestWorldCopyPosition, normalizeImageGraphic, normalizeMarker, normalizeNoteGraphic, noteFootprint, noteOpacity, parseColor, pickHitTolerance, pickPointerType, pinDistanceScale, pinZoomScale, placePointSymbol, pointSymbolFootprint, pointSymbolResource, renderNoteForAdapter, renderOrderToVisualOrder, resetGroundSizeOptions, resizePointSymbolSize, resolveGroundTextSizePixels, resolveHighlightBands, resolveHighlightCasing, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker, validateNoteGraphic };
|
package/dist/index.mjs
CHANGED
|
@@ -7618,6 +7618,7 @@ function runGroupTransform(opts) {
|
|
|
7618
7618
|
assertCapabilityFor(graphics);
|
|
7619
7619
|
validateHostResources(graphics);
|
|
7620
7620
|
let sizeAnchor = opts.sizeAnchor ?? defaultGroupSizeAnchor(graphics);
|
|
7621
|
+
let memberOutlines = opts.memberOutlines ?? true;
|
|
7621
7622
|
/** Throw synchronously if any graphic in `list` is a point symbol and no capability was supplied. */
|
|
7622
7623
|
function assertCapabilityFor(list) {
|
|
7623
7624
|
if (!capability && list.some(isPointSymbol)) throw new PointSymbolCapabilityRequiredError();
|
|
@@ -8038,7 +8039,7 @@ function runGroupTransform(opts) {
|
|
|
8038
8039
|
features.push(boxOutlineFeature(liveGroupBox, dragProjection.fromPixel, `${handleIdPrefix}:box-outline`, groupOutlineStyle(interactionStyle?.boxOutline)));
|
|
8039
8040
|
features.push(...toFeatures(boxToHandles(liveGroupBox, dragProjection.fromPixel), handleIdPrefix, interactionStyle));
|
|
8040
8041
|
}
|
|
8041
|
-
features.push(...memberOutlineFeatures(members.flatMap((member) => member.box ? [[member.graphic.id, member.box]] : []), dragProjection.fromPixel, handleIdPrefix, interactionStyle?.boxOutline));
|
|
8042
|
+
if (memberOutlines) features.push(...memberOutlineFeatures(members.flatMap((member) => member.box ? [[member.graphic.id, member.box]] : []), dragProjection.fromPixel, handleIdPrefix, interactionStyle?.boxOutline));
|
|
8042
8043
|
ctx.writeLayer(handlesLayer, [{
|
|
8043
8044
|
id: "__td_transform_handles__",
|
|
8044
8045
|
features,
|
|
@@ -8364,6 +8365,14 @@ function runGroupTransform(opts) {
|
|
|
8364
8365
|
setSizeAnchor(next) {
|
|
8365
8366
|
setSizeAnchor(next);
|
|
8366
8367
|
},
|
|
8368
|
+
get memberOutlines() {
|
|
8369
|
+
return memberOutlines;
|
|
8370
|
+
},
|
|
8371
|
+
setMemberOutlines(visible) {
|
|
8372
|
+
if (ctx.settled || memberOutlines === visible) return;
|
|
8373
|
+
memberOutlines = visible;
|
|
8374
|
+
renderHandlesLayer();
|
|
8375
|
+
},
|
|
8367
8376
|
setGraphics,
|
|
8368
8377
|
syncHostGraphics,
|
|
8369
8378
|
close,
|
|
@@ -10479,6 +10488,8 @@ var TacticalDraw = class {
|
|
|
10479
10488
|
* `render()` so outlines track geometry, style, and dropped graphics.
|
|
10480
10489
|
*/
|
|
10481
10490
|
highlightedIds = [];
|
|
10491
|
+
/** Graphic sets outlined as one box each ({@link setHighlightedGroups}). */
|
|
10492
|
+
highlightedGroups = [];
|
|
10482
10493
|
pinBodies = /* @__PURE__ */ new WeakMap();
|
|
10483
10494
|
/** Resolved marker icons, so pin, highlight and view rebuilds don't re-ask the host. */
|
|
10484
10495
|
markerRenders = /* @__PURE__ */ new WeakMap();
|
|
@@ -11014,6 +11025,24 @@ var TacticalDraw = class {
|
|
|
11014
11025
|
this.highlightCoalescer.schedule();
|
|
11015
11026
|
}
|
|
11016
11027
|
/**
|
|
11028
|
+
* Replace the passive group outlines with `groups`: one outline box around
|
|
11029
|
+
* the joint bounds of each group's still-rendered graphics, drawn with the
|
|
11030
|
+
* same style and on the same layer as {@link setHighlightedGraphics}, which
|
|
11031
|
+
* it sits beside. Declarative like that set: `[]` clears every group
|
|
11032
|
+
* outline. A graphic in an active edit or transform session still counts
|
|
11033
|
+
* toward its group's bounds (at its last rendered geometry), so a host can
|
|
11034
|
+
* frame the group around a member being edited on its own. A group with no
|
|
11035
|
+
* rendered graphic draws nothing.
|
|
11036
|
+
*/
|
|
11037
|
+
setHighlightedGroups(groups) {
|
|
11038
|
+
this.assertAlive();
|
|
11039
|
+
this.highlightedGroups = groups.map((group) => ({
|
|
11040
|
+
id: group.id,
|
|
11041
|
+
graphicIds: group.graphicIds.slice()
|
|
11042
|
+
}));
|
|
11043
|
+
this.highlightCoalescer.schedule();
|
|
11044
|
+
}
|
|
11045
|
+
/**
|
|
11017
11046
|
* Cancel any pending coalesced highlight frame and re-project highlights
|
|
11018
11047
|
* immediately. Used by every caller other than `setHighlightedGraphics`
|
|
11019
11048
|
* (`render()`, view-change, session start / settle) so their own
|
|
@@ -11035,7 +11064,7 @@ var TacticalDraw = class {
|
|
|
11035
11064
|
*/
|
|
11036
11065
|
renderHighlights() {
|
|
11037
11066
|
if (this.destroyed) return;
|
|
11038
|
-
if (this.highlightedIds.length === 0 && !this.hasHighlightOutlines) return;
|
|
11067
|
+
if (this.highlightedIds.length === 0 && this.highlightedGroups.length === 0 && !this.hasHighlightOutlines) return;
|
|
11039
11068
|
const fromPixel = this.adapter.getCoordinateFromPixel?.bind(this.adapter);
|
|
11040
11069
|
if (!fromPixel) return;
|
|
11041
11070
|
const resolved = this.resolveInteractionStyle(void 0);
|
|
@@ -11045,6 +11074,28 @@ var TacticalDraw = class {
|
|
|
11045
11074
|
const bearing = this.adapter.getBearing();
|
|
11046
11075
|
const features = [];
|
|
11047
11076
|
const pinGroups = [];
|
|
11077
|
+
const pushOutline = (box, featureId) => {
|
|
11078
|
+
let invertFailed = false;
|
|
11079
|
+
const invert = (pixel) => {
|
|
11080
|
+
const coord = fromPixel(pixel);
|
|
11081
|
+
if (!coord) {
|
|
11082
|
+
invertFailed = true;
|
|
11083
|
+
return [pixel[0], pixel[1]];
|
|
11084
|
+
}
|
|
11085
|
+
return coord;
|
|
11086
|
+
};
|
|
11087
|
+
const feature = boxOutlineFeature(box, invert, featureId, style);
|
|
11088
|
+
if (!invertFailed) features.push(feature);
|
|
11089
|
+
};
|
|
11090
|
+
const boxes = /* @__PURE__ */ new Map();
|
|
11091
|
+
const boxFor = (graphic) => {
|
|
11092
|
+
let box = boxes.get(graphic.id);
|
|
11093
|
+
if (box === void 0) {
|
|
11094
|
+
box = this.highlightBoxForGraphic(graphic, bearing, padding);
|
|
11095
|
+
boxes.set(graphic.id, box);
|
|
11096
|
+
}
|
|
11097
|
+
return box;
|
|
11098
|
+
};
|
|
11048
11099
|
for (const id of this.highlightedIds) {
|
|
11049
11100
|
if (excluded.has(id)) continue;
|
|
11050
11101
|
const graphic = this.lastRenderedMeasuresById.get(id);
|
|
@@ -11064,19 +11115,18 @@ var TacticalDraw = class {
|
|
|
11064
11115
|
continue;
|
|
11065
11116
|
}
|
|
11066
11117
|
}
|
|
11067
|
-
const box =
|
|
11068
|
-
if (
|
|
11069
|
-
|
|
11070
|
-
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
if (!invertFailed) features.push(feature);
|
|
11118
|
+
const box = boxFor(graphic);
|
|
11119
|
+
if (box) pushOutline(box, `__td_highlight__:${id}`);
|
|
11120
|
+
}
|
|
11121
|
+
for (const group of this.highlightedGroups) {
|
|
11122
|
+
const corners = [];
|
|
11123
|
+
for (const id of group.graphicIds) {
|
|
11124
|
+
const graphic = this.lastRenderedMeasuresById.get(id);
|
|
11125
|
+
const box = graphic && boxFor(graphic);
|
|
11126
|
+
if (box) corners.push(...boxCorners(box));
|
|
11127
|
+
}
|
|
11128
|
+
const box = fitTransformBox(corners, bearing);
|
|
11129
|
+
if (box) pushOutline(box, `__td_highlight_group__:${group.id}`);
|
|
11080
11130
|
}
|
|
11081
11131
|
this.adapter.setLayerFeatureGroups(this.highlightLayer, [...pinGroups, ...features.map((feature) => ({
|
|
11082
11132
|
id: String(feature.id),
|
|
@@ -11603,7 +11653,8 @@ var TacticalDraw = class {
|
|
|
11603
11653
|
onSettled,
|
|
11604
11654
|
onClickAwayGraphicsPick,
|
|
11605
11655
|
editModifiers: this.currentEditModifiers,
|
|
11606
|
-
snap: this.resolveSnap
|
|
11656
|
+
snap: this.resolveSnap,
|
|
11657
|
+
memberOutlines: options?.memberOutlines
|
|
11607
11658
|
}), (handle) => {
|
|
11608
11659
|
this.activeTransform = handle;
|
|
11609
11660
|
return () => {
|
|
@@ -11650,6 +11701,7 @@ var TacticalDraw = class {
|
|
|
11650
11701
|
this.assertAlive();
|
|
11651
11702
|
const session = this.activeTransformSessionRef;
|
|
11652
11703
|
if (session) {
|
|
11704
|
+
if (options?.memberOutlines !== void 0) session.setMemberOutlines(options.memberOutlines);
|
|
11653
11705
|
if (session.setGraphics(graphics) !== void 0) return;
|
|
11654
11706
|
}
|
|
11655
11707
|
if (graphics.length === 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orbat-mapper/tactical-draw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.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",
|