@orbat-mapper/tactical-draw 0.21.0 → 0.22.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,5 +1,5 @@
|
|
|
1
|
-
import { $ as PinPresentationStatusEvent, A as PointSymbolAnchor, B as PointSymbolSize, C as makeFillPatternImage, D as PointerEventInfo, E as PointerCallback, F as PointSymbolOffset, G as DEFAULT_PIN_PRESENTATION, H as clonePointSymbol, I as PointSymbolOffsetStyle, J as PinPresentation, K as PinFootprint, L as PointSymbolPlacement, M as PointSymbolColors, N as PointSymbolConnector, O as OffsetDragModifier, P as PointSymbolGraphicModifiers, Q as PinPresentationStatus, R as PointSymbolRect, S as isMinePattern, T as EditPointerDriver, U as isPointSymbol, V as PointSymbolStyle, W as resizePointSymbolSize, X as PinPresentationPatch, Y as PinPresentationCapability, Z as PinPresentationState, _ as HatchPattern, a as LayerId, at as pinZoomScale, b as fillPatternImageDimension, c as MapEvent, d as PickHandler, et as PinPresentationStore, f as PickOptions, g as HATCH_PATTERNS, h as TextStyleOptions, i as ImageOverlayResource, it as pinDistanceScale, j as PointSymbolCapability, k as PointSymbol, l as MapEventHandler, m as StyleOptions, n as HandleStyle, nt as combinePinScale, o as MapAdapter, ot as resolvePinPresentation, p as PixelCoordinate, q as PinOverridePatch, r as IconResource, rt as isValidPinNumber, s as MapCursor, t as FeatureGroup, tt as PinRender, u as PickEvent, v as MINE_PATTERN_TILE_SIZE, w as parseColor, x as fillPatternImageId, y as Rgba, z as PointSymbolRender } from "./map-adapter-
|
|
2
|
-
import { AmplifierPlacement, AmplifierPlacements, ControlMeasure, ControlMeasureKind, ControlMeasureRender, ControlMeasureStyle, LabelFit, SymbolColors, TextAmplifiers } from "@orbat-mapper/control-measures";
|
|
1
|
+
import { $ as PinPresentationStatusEvent, A as PointSymbolAnchor, B as PointSymbolSize, C as makeFillPatternImage, D as PointerEventInfo, E as PointerCallback, F as PointSymbolOffset, G as DEFAULT_PIN_PRESENTATION, H as clonePointSymbol, I as PointSymbolOffsetStyle, J as PinPresentation, K as PinFootprint, L as PointSymbolPlacement, M as PointSymbolColors, N as PointSymbolConnector, O as OffsetDragModifier, P as PointSymbolGraphicModifiers, Q as PinPresentationStatus, R as PointSymbolRect, S as isMinePattern, T as EditPointerDriver, U as isPointSymbol, V as PointSymbolStyle, W as resizePointSymbolSize, X as PinPresentationPatch, Y as PinPresentationCapability, Z as PinPresentationState, _ as HatchPattern, a as LayerId, at as pinZoomScale, b as fillPatternImageDimension, c as MapEvent, d as PickHandler, et as PinPresentationStore, f as PickOptions, g as HATCH_PATTERNS, h as TextStyleOptions, i as ImageOverlayResource, it as pinDistanceScale, j as PointSymbolCapability, k as PointSymbol, l as MapEventHandler, m as StyleOptions, n as HandleStyle, nt as combinePinScale, o as MapAdapter, ot as resolvePinPresentation, p as PixelCoordinate, q as PinOverridePatch, r as IconResource, rt as isValidPinNumber, s as MapCursor, t as FeatureGroup, tt as PinRender, u as PickEvent, v as MINE_PATTERN_TILE_SIZE, w as parseColor, x as fillPatternImageId, y as Rgba, z as PointSymbolRender } from "./map-adapter-Btuz2FLI.mjs";
|
|
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
|
|
|
5
5
|
//#region src/base-map-adapter.d.ts
|
|
@@ -219,14 +219,15 @@ declare function resolvePickPresentation(feature: Feature, layerStyle?: StyleOpt
|
|
|
219
219
|
*/
|
|
220
220
|
declare function coerceHandleStyle(raw: unknown): HandleStyle | undefined;
|
|
221
221
|
/**
|
|
222
|
-
*
|
|
223
|
-
* pixels
|
|
224
|
-
*
|
|
225
|
-
* highlighter mark, narrow enough not to
|
|
222
|
+
* Default reach of a Highlight casing past each side of the stroke, in CSS
|
|
223
|
+
* pixels, when the renderer emitted no `highlightWidth`. The casing is a solid
|
|
224
|
+
* line `strokeWidth + 2 × outset` wide, so the default 2 px stroke gets an
|
|
225
|
+
* 8 px band: wide enough to read as a highlighter mark, narrow enough not to
|
|
226
|
+
* swallow neighbouring graphics. The renderer's `DEFAULT_HIGHLIGHT_WIDTH`.
|
|
226
227
|
*/
|
|
227
228
|
declare const HIGHLIGHT_CASING_OUTSET_CSS_PIXELS = 3;
|
|
228
229
|
/** Width of the Highlight casing beneath a stroke `strokeWidth` px wide. */
|
|
229
|
-
declare function highlightCasingWidth(strokeWidth: number): number;
|
|
230
|
+
declare function highlightCasingWidth(strokeWidth: number, outset?: number): number;
|
|
230
231
|
/** The solid casing an adapter paints beneath a highlighted part. */
|
|
231
232
|
interface HighlightCasing {
|
|
232
233
|
color: string;
|
|
@@ -234,16 +235,65 @@ interface HighlightCasing {
|
|
|
234
235
|
width: number;
|
|
235
236
|
}
|
|
236
237
|
/**
|
|
237
|
-
*
|
|
238
|
-
*
|
|
238
|
+
* Where a Highlight band sits, bottom to top. Every part's glow bands paint
|
|
239
|
+
* beneath every part's casing in the same graphic, outer glow lowest.
|
|
240
|
+
*/
|
|
241
|
+
type HighlightBandSlot = "glow-outer" | "glow-inner" | "casing";
|
|
242
|
+
/** Bottom-to-top order of {@link HighlightBandSlot}s. */
|
|
243
|
+
declare const HIGHLIGHT_BAND_SLOTS: readonly HighlightBandSlot[];
|
|
244
|
+
/**
|
|
245
|
+
* The fading glow bands outside the casing (ADR-0062): each reaches `reach ×
|
|
246
|
+
* highlightGlow` past the casing on each side at a constant `opacity`. Plain
|
|
247
|
+
* translucent strokes, never a blur, so they cost no more to draw than the
|
|
248
|
+
* casing and print the same in every output.
|
|
249
|
+
*/
|
|
250
|
+
declare const HIGHLIGHT_GLOW_BANDS: Readonly<Record<Exclude<HighlightBandSlot, "casing">, {
|
|
251
|
+
reach: number;
|
|
252
|
+
opacity: number;
|
|
253
|
+
}>>;
|
|
254
|
+
/** One stroke of a part's Highlight: its casing or a glow band. */
|
|
255
|
+
interface HighlightBand {
|
|
256
|
+
slot: HighlightBandSlot;
|
|
257
|
+
color: string;
|
|
258
|
+
/** Full band width in CSS pixels. */
|
|
259
|
+
width: number;
|
|
260
|
+
/** Stroke opacity, multiplied with any alpha already in `color`. */
|
|
261
|
+
opacity: number;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Whether a rendered feature gets a Highlight: only a line or area part whose
|
|
265
|
+
* `properties.style` carries the renderer's resolved `highlightColor`.
|
|
239
266
|
*/
|
|
240
267
|
declare function hasHighlightCasing(feature: Feature): boolean;
|
|
241
268
|
/**
|
|
242
|
-
* The Highlight
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
269
|
+
* The Highlight bands for a rendered feature, bottom to top: the glow bands
|
|
270
|
+
* when it has a glow, the casing when its outset is above `0`; empty when it
|
|
271
|
+
* is not highlighted. An area is cased along its outline. Widths follow the
|
|
272
|
+
* part's own `strokeWidth`, else `fallbackStrokeWidth` — the stroke width the
|
|
273
|
+
* adapter would draw it at — whatever the stroke color, so a fully transparent
|
|
274
|
+
* stroke is cased too.
|
|
275
|
+
*/
|
|
276
|
+
declare function resolveHighlightBands(feature: Feature, fallbackStrokeWidth: number): HighlightBand[];
|
|
277
|
+
/**
|
|
278
|
+
* {@link resolveHighlightBands} for an adapter that already knows the part is
|
|
279
|
+
* a line or area and holds only its resolved `HandleStyle`.
|
|
280
|
+
*/
|
|
281
|
+
declare function highlightBandsForStyle(style: HandleStyle, fallbackStrokeWidth: number): HighlightBand[];
|
|
282
|
+
/** One Highlight band of one rendered feature; see {@link highlightBandsInPaintOrder}. */
|
|
283
|
+
interface FeatureHighlightBand<F extends Feature = Feature> {
|
|
284
|
+
feature: F;
|
|
285
|
+
band: HighlightBand;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Every Highlight band of one graphic's features in paint order (ADR-0062):
|
|
289
|
+
* slot by slot, so every glow band paints beneath every casing, and in feature
|
|
290
|
+
* order within a slot. Adapters paint the result as-is, beneath all of the
|
|
291
|
+
* graphic's other paint.
|
|
292
|
+
*/
|
|
293
|
+
declare function highlightBandsInPaintOrder<F extends Feature>(features: readonly F[], fallbackStrokeWidth: number): FeatureHighlightBand<F>[];
|
|
294
|
+
/**
|
|
295
|
+
* The solid Highlight casing for a rendered feature, or `null` when it has
|
|
296
|
+
* none; see {@link resolveHighlightBands} for the casing plus its glow bands.
|
|
247
297
|
*/
|
|
248
298
|
declare function resolveHighlightCasing(feature: Feature, fallbackStrokeWidth: number): HighlightCasing | null;
|
|
249
299
|
/**
|
|
@@ -1481,6 +1531,13 @@ interface TacticalDrawOptions {
|
|
|
1481
1531
|
graphicsStyle?: ControlMeasureStyle;
|
|
1482
1532
|
/** Doctrinal defaults; explicit style colors take precedence. */
|
|
1483
1533
|
symbolColors?: SymbolColors;
|
|
1534
|
+
/**
|
|
1535
|
+
* How every graphic with `style.highlight` looks (ADR-0062): casing color,
|
|
1536
|
+
* casing width past the stroke and glow reach, all in CSS pixels. Omitted
|
|
1537
|
+
* fields keep their defaults (a 3 px orange casing, no glow). Change it
|
|
1538
|
+
* later with {@link TacticalDraw.setHighlightAppearance}.
|
|
1539
|
+
*/
|
|
1540
|
+
highlightAppearance?: HighlightAppearance;
|
|
1484
1541
|
/**
|
|
1485
1542
|
* Pixel band for ground-anchored labels on the graphics and preview layers
|
|
1486
1543
|
* (ADR-0060). A label stops growing at `textSizeMaxPixels` (default 24) and,
|
|
@@ -1675,6 +1732,11 @@ declare class TacticalDraw {
|
|
|
1675
1732
|
private readonly ownedLayers;
|
|
1676
1733
|
private readonly graphicsStyle;
|
|
1677
1734
|
private readonly symbolColors;
|
|
1735
|
+
/**
|
|
1736
|
+
* Render options shared by the graphics layer and every draw, edit and
|
|
1737
|
+
* transform session; `setHighlightAppearance` updates it in place.
|
|
1738
|
+
*/
|
|
1739
|
+
private readonly sessionRenderOptions;
|
|
1678
1740
|
private readonly labelSizeBand;
|
|
1679
1741
|
private labelFit;
|
|
1680
1742
|
private readonly defaultInteractionStyle;
|
|
@@ -1827,6 +1889,16 @@ declare class TacticalDraw {
|
|
|
1827
1889
|
* {@link TacticalDrawOptions.labelFit}.
|
|
1828
1890
|
*/
|
|
1829
1891
|
setLabelFit(labelFit: LabelFit): void;
|
|
1892
|
+
/** The current app-wide Highlight appearance; see {@link setHighlightAppearance}. */
|
|
1893
|
+
getHighlightAppearance(): HighlightAppearance;
|
|
1894
|
+
/**
|
|
1895
|
+
* Change how highlighted graphics look (ADR-0062), merging `patch` into the
|
|
1896
|
+
* current appearance: a field set to `undefined` returns to its default.
|
|
1897
|
+
* Re-renders the graphics layer and any graphic being drawn, edited or
|
|
1898
|
+
* transformed; a no-op when nothing changes. See
|
|
1899
|
+
* {@link TacticalDrawOptions.highlightAppearance}.
|
|
1900
|
+
*/
|
|
1901
|
+
setHighlightAppearance(patch: HighlightAppearance): void;
|
|
1830
1902
|
/** Replace snapping configuration without recreating the map adapter or façade. */
|
|
1831
1903
|
setSnappingOptions(options?: SnappingOptions): void;
|
|
1832
1904
|
/** Clear transient host affordances when snapping or its interaction ends. */
|
|
@@ -2326,4 +2398,4 @@ declare function nearestWorldCopyLng(lng: number, refLng: number): number;
|
|
|
2326
2398
|
/** `nearestWorldCopyLng` applied to a lon/lat position. */
|
|
2327
2399
|
declare function nearestWorldCopyPosition(position: Position, refLng: number): Position;
|
|
2328
2400
|
//#endregion
|
|
2329
|
-
export { type AnchoredGraphic, BaseMapAdapter, type CombinedAbort, 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 DrawOptions, type DrawPointSymbolDraft, type DrawSession, type EditChangeEvent, type EditManyOptions, type EditMode, type EditOptions, type EditPointerDriver, type EditSession, type FeatureGroup, type Graphic, type GraphicEditChangeEvent, type GraphicEditSession, type GraphicGeometrySnappingOptions, type GraphicRender, type GraphicSnapshot, type GuideStyle, HATCH_PATTERNS, HIGHLIGHT_CASING_OUTSET_CSS_PIXELS, type HandleStyle, type HatchPattern, 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 NativeEventEntry, 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 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, cloneImageGraphic, cloneMarker, clonePointSymbol, coerceHandleStyle, combinePinScale, combineWithHostSignal, convertPointSymbolPlacement, effectivePointSymbolPixelSize, evaluatePickCandidates, fillPatternImageDimension, fillPatternImageId, getSizeAnchor, hasHighlightCasing, highlightCasingWidth, hitTestFeature, hitTestIconFeature, ignoreAbort, imageFootprint, imageOpacity, isAnchoredGraphic, isImageGraphic, isMarker, isMinePattern, isPinnableGraphic, isPointSymbol, isTacticalDrawAbortError, isValidPinNumber, makeFillPatternImage, markerFootprint, markerOpacity, mergeNativeAndCachedPickFeatures, movePointSymbolLocation, nearestWorldCopyLng, nearestWorldCopyPosition, normalizeImageGraphic, normalizeMarker, parseColor, pickHitTolerance, pickPointerType, pinDistanceScale, pinZoomScale, placePointSymbol, pointSymbolFootprint, pointSymbolResource, renderOrderToVisualOrder, resizePointSymbolSize, resolveGroundTextSizePixels, resolveHighlightCasing, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
|
|
2401
|
+
export { type AnchoredGraphic, BaseMapAdapter, type CombinedAbort, 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 DrawOptions, type DrawPointSymbolDraft, type DrawSession, type EditChangeEvent, type EditManyOptions, type EditMode, 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 NativeEventEntry, 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 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, cloneImageGraphic, cloneMarker, clonePointSymbol, coerceHandleStyle, combinePinScale, combineWithHostSignal, convertPointSymbolPlacement, effectivePointSymbolPixelSize, evaluatePickCandidates, fillPatternImageDimension, fillPatternImageId, getSizeAnchor, hasHighlightCasing, highlightBandsForStyle, highlightBandsInPaintOrder, highlightCasingWidth, hitTestFeature, hitTestIconFeature, ignoreAbort, imageFootprint, imageOpacity, isAnchoredGraphic, isImageGraphic, isMarker, isMinePattern, isPinnableGraphic, isPointSymbol, isTacticalDrawAbortError, isValidPinNumber, makeFillPatternImage, markerFootprint, markerOpacity, mergeNativeAndCachedPickFeatures, movePointSymbolLocation, nearestWorldCopyLng, nearestWorldCopyPosition, normalizeImageGraphic, normalizeMarker, parseColor, pickHitTolerance, pickPointerType, pinDistanceScale, pinZoomScale, placePointSymbol, pointSymbolFootprint, pointSymbolResource, renderOrderToVisualOrder, resizePointSymbolSize, resolveGroundTextSizePixels, resolveHighlightBands, resolveHighlightCasing, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_LABEL_HEIGHT_CSS_PIXELS, DEFAULT_SYMBOL_COLOR, FILL_PATTERN_DEFINITIONS, NON_SOLID_FILL_PATTERNS, applyBoxTransformOptions, canonicalTextAmplifierKey, cloneControlMeasure, controlMeasureIdFromFeature, dragControlMeasureOptionHandle, foldsBoxTransformOptions, freezeOrientationOptions, getControlMeasureMetadata, getControlMeasureOptionHandles, getDefaultOptions, normalizeTextAmplifiers, remapVertexAlignedOptions, renderControlMeasure, resetControlMeasureOptionHandle, resolveAmplifierPlacement, resolveSizePair, resolveStyleHints, resolveSymbolColor, roundToFixed, switchSizePairUnit } from "@orbat-mapper/control-measures";
|
|
1
|
+
import { DEFAULT_HIGHLIGHT_WIDTH, DEFAULT_LABEL_HEIGHT_CSS_PIXELS, DEFAULT_SYMBOL_COLOR, FILL_PATTERN_DEFINITIONS, NON_SOLID_FILL_PATTERNS, applyBoxTransformOptions, canonicalTextAmplifierKey, cloneControlMeasure, controlMeasureIdFromFeature, dragControlMeasureOptionHandle, foldsBoxTransformOptions, freezeOrientationOptions, getControlMeasureMetadata, getControlMeasureOptionHandles, getDefaultOptions, normalizeTextAmplifiers, remapVertexAlignedOptions, renderControlMeasure, resetControlMeasureOptionHandle, resolveAmplifierPlacement, resolveSizePair, resolveStyleHints, resolveSymbolColor, roundToFixed, switchSizePairUnit } from "@orbat-mapper/control-measures";
|
|
2
2
|
function pickPointerType(originalEvent) {
|
|
3
3
|
if (typeof PointerEvent !== "undefined" && originalEvent instanceof PointerEvent) {
|
|
4
4
|
if (originalEvent.pointerType === "touch") return "touch";
|
|
@@ -648,16 +648,39 @@ function coerceHandleStyle(raw) {
|
|
|
648
648
|
return raw;
|
|
649
649
|
}
|
|
650
650
|
/**
|
|
651
|
-
*
|
|
652
|
-
* pixels
|
|
653
|
-
*
|
|
654
|
-
* highlighter mark, narrow enough not to
|
|
651
|
+
* Default reach of a Highlight casing past each side of the stroke, in CSS
|
|
652
|
+
* pixels, when the renderer emitted no `highlightWidth`. The casing is a solid
|
|
653
|
+
* line `strokeWidth + 2 × outset` wide, so the default 2 px stroke gets an
|
|
654
|
+
* 8 px band: wide enough to read as a highlighter mark, narrow enough not to
|
|
655
|
+
* swallow neighbouring graphics. The renderer's `DEFAULT_HIGHLIGHT_WIDTH`.
|
|
655
656
|
*/
|
|
656
|
-
const HIGHLIGHT_CASING_OUTSET_CSS_PIXELS =
|
|
657
|
+
const HIGHLIGHT_CASING_OUTSET_CSS_PIXELS = DEFAULT_HIGHLIGHT_WIDTH;
|
|
657
658
|
/** Width of the Highlight casing beneath a stroke `strokeWidth` px wide. */
|
|
658
|
-
function highlightCasingWidth(strokeWidth) {
|
|
659
|
-
return strokeWidth +
|
|
660
|
-
}
|
|
659
|
+
function highlightCasingWidth(strokeWidth, outset = HIGHLIGHT_CASING_OUTSET_CSS_PIXELS) {
|
|
660
|
+
return strokeWidth + 2 * outset;
|
|
661
|
+
}
|
|
662
|
+
/** Bottom-to-top order of {@link HighlightBandSlot}s. */
|
|
663
|
+
const HIGHLIGHT_BAND_SLOTS = [
|
|
664
|
+
"glow-outer",
|
|
665
|
+
"glow-inner",
|
|
666
|
+
"casing"
|
|
667
|
+
];
|
|
668
|
+
/**
|
|
669
|
+
* The fading glow bands outside the casing (ADR-0062): each reaches `reach ×
|
|
670
|
+
* highlightGlow` past the casing on each side at a constant `opacity`. Plain
|
|
671
|
+
* translucent strokes, never a blur, so they cost no more to draw than the
|
|
672
|
+
* casing and print the same in every output.
|
|
673
|
+
*/
|
|
674
|
+
const HIGHLIGHT_GLOW_BANDS = {
|
|
675
|
+
"glow-outer": {
|
|
676
|
+
reach: 1,
|
|
677
|
+
opacity: .22
|
|
678
|
+
},
|
|
679
|
+
"glow-inner": {
|
|
680
|
+
reach: .5,
|
|
681
|
+
opacity: .45
|
|
682
|
+
}
|
|
683
|
+
};
|
|
661
684
|
const CASED_GEOMETRIES = new Set([
|
|
662
685
|
"LineString",
|
|
663
686
|
"MultiLineString",
|
|
@@ -665,26 +688,82 @@ const CASED_GEOMETRIES = new Set([
|
|
|
665
688
|
"MultiPolygon"
|
|
666
689
|
]);
|
|
667
690
|
/**
|
|
668
|
-
* Whether a rendered feature gets a Highlight
|
|
669
|
-
*
|
|
691
|
+
* Whether a rendered feature gets a Highlight: only a line or area part whose
|
|
692
|
+
* `properties.style` carries the renderer's resolved `highlightColor`.
|
|
670
693
|
*/
|
|
671
694
|
function hasHighlightCasing(feature) {
|
|
672
695
|
return typeof coerceHandleStyle(feature.properties?.style)?.highlightColor === "string" && CASED_GEOMETRIES.has(feature.geometry?.type ?? "");
|
|
673
696
|
}
|
|
674
697
|
/**
|
|
675
|
-
* The Highlight
|
|
676
|
-
*
|
|
677
|
-
*
|
|
678
|
-
*
|
|
679
|
-
*
|
|
698
|
+
* The Highlight bands for a rendered feature, bottom to top: the glow bands
|
|
699
|
+
* when it has a glow, the casing when its outset is above `0`; empty when it
|
|
700
|
+
* is not highlighted. An area is cased along its outline. Widths follow the
|
|
701
|
+
* part's own `strokeWidth`, else `fallbackStrokeWidth` — the stroke width the
|
|
702
|
+
* adapter would draw it at — whatever the stroke color, so a fully transparent
|
|
703
|
+
* stroke is cased too.
|
|
704
|
+
*/
|
|
705
|
+
function resolveHighlightBands(feature, fallbackStrokeWidth) {
|
|
706
|
+
if (!hasHighlightCasing(feature)) return [];
|
|
707
|
+
return highlightBandsForStyle(coerceHandleStyle(feature.properties?.style), fallbackStrokeWidth);
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* {@link resolveHighlightBands} for an adapter that already knows the part is
|
|
711
|
+
* a line or area and holds only its resolved `HandleStyle`.
|
|
712
|
+
*/
|
|
713
|
+
function highlightBandsForStyle(style, fallbackStrokeWidth) {
|
|
714
|
+
if (typeof style.highlightColor !== "string") return [];
|
|
715
|
+
const color = style.highlightColor;
|
|
716
|
+
const strokeWidth = typeof style.strokeWidth === "number" ? style.strokeWidth : fallbackStrokeWidth;
|
|
717
|
+
const outset = nonNegativeOr(style.highlightWidth, HIGHLIGHT_CASING_OUTSET_CSS_PIXELS);
|
|
718
|
+
const glow = nonNegativeOr(style.highlightGlow, 0);
|
|
719
|
+
const casingWidth = highlightCasingWidth(strokeWidth, outset);
|
|
720
|
+
return HIGHLIGHT_BAND_SLOTS.flatMap((slot) => {
|
|
721
|
+
if (slot === "casing") return outset > 0 ? [{
|
|
722
|
+
slot,
|
|
723
|
+
color,
|
|
724
|
+
width: casingWidth,
|
|
725
|
+
opacity: 1
|
|
726
|
+
}] : [];
|
|
727
|
+
if (glow === 0) return [];
|
|
728
|
+
const { reach, opacity } = HIGHLIGHT_GLOW_BANDS[slot];
|
|
729
|
+
return [{
|
|
730
|
+
slot,
|
|
731
|
+
color,
|
|
732
|
+
width: casingWidth + 2 * reach * glow,
|
|
733
|
+
opacity
|
|
734
|
+
}];
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
const SLOT_ORDER = {
|
|
738
|
+
"glow-outer": 0,
|
|
739
|
+
"glow-inner": 1,
|
|
740
|
+
casing: 2
|
|
741
|
+
};
|
|
742
|
+
/**
|
|
743
|
+
* Every Highlight band of one graphic's features in paint order (ADR-0062):
|
|
744
|
+
* slot by slot, so every glow band paints beneath every casing, and in feature
|
|
745
|
+
* order within a slot. Adapters paint the result as-is, beneath all of the
|
|
746
|
+
* graphic's other paint.
|
|
747
|
+
*/
|
|
748
|
+
function highlightBandsInPaintOrder(features, fallbackStrokeWidth) {
|
|
749
|
+
return features.flatMap((feature) => resolveHighlightBands(feature, fallbackStrokeWidth).map((band) => ({
|
|
750
|
+
feature,
|
|
751
|
+
band
|
|
752
|
+
}))).sort((a, b) => SLOT_ORDER[a.band.slot] - SLOT_ORDER[b.band.slot]);
|
|
753
|
+
}
|
|
754
|
+
function nonNegativeOr(value, fallback) {
|
|
755
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : fallback;
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* The solid Highlight casing for a rendered feature, or `null` when it has
|
|
759
|
+
* none; see {@link resolveHighlightBands} for the casing plus its glow bands.
|
|
680
760
|
*/
|
|
681
761
|
function resolveHighlightCasing(feature, fallbackStrokeWidth) {
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
};
|
|
762
|
+
const casing = resolveHighlightBands(feature, fallbackStrokeWidth).find((band) => band.slot === "casing");
|
|
763
|
+
return casing ? {
|
|
764
|
+
color: casing.color,
|
|
765
|
+
width: casing.width
|
|
766
|
+
} : null;
|
|
688
767
|
}
|
|
689
768
|
/**
|
|
690
769
|
* Default lower edge of the ground-anchored label band (ADR-0060): below it a
|
|
@@ -2176,17 +2255,6 @@ function withCommittedAdapterMeasureOptions(measure) {
|
|
|
2176
2255
|
}
|
|
2177
2256
|
};
|
|
2178
2257
|
}
|
|
2179
|
-
/**
|
|
2180
|
-
* Render a measure with the adapter's live scale supplied through core's
|
|
2181
|
-
* renderer-owned context. The single seam for
|
|
2182
|
-
* "turn a measure into features against the live map" — every TacticalDraw
|
|
2183
|
-
* layer write (graphics reconcile, draw preview, edit preview, commit snapshot)
|
|
2184
|
-
* routes through here so pixel sizing is resolved identically everywhere. The
|
|
2185
|
-
* adapter resolution is Web Mercator construction scale; converting it to true
|
|
2186
|
-
* ground at the Graphic midpoint lets core's compatibility boundary round-trip
|
|
2187
|
-
* to the same construction scale. Default label capture remains a derived copy
|
|
2188
|
-
* for previews, while the input Graphic is never augmented with live scale.
|
|
2189
|
-
*/
|
|
2190
2258
|
function renderMeasureForAdapter(adapter, measure, opts) {
|
|
2191
2259
|
const withLabelSize = withCommittedAdapterMeasureOptions(measure);
|
|
2192
2260
|
const resolution = adapter.getResolution();
|
|
@@ -2719,7 +2787,7 @@ const PREVIEW_CURSOR$1 = "crosshair";
|
|
|
2719
2787
|
* kinds need no host UI.
|
|
2720
2788
|
*/
|
|
2721
2789
|
function runFixedLengthDraw(options) {
|
|
2722
|
-
const { adapter, kind, previewLayer, guideLayer,
|
|
2790
|
+
const { adapter, kind, previewLayer, guideLayer, renderOptions: renderOpts, generateId, signal, measureOptions, measureStyle, measureProperties, measureTextAmplifiers, guide: guideOpt, sizeAnchor, onSettled, onSession, seed, snap } = options;
|
|
2723
2791
|
const metadata = getControlMeasureMetadata(kind);
|
|
2724
2792
|
const rule = metadata.rule;
|
|
2725
2793
|
const min = metadata.minCoordinates;
|
|
@@ -2728,10 +2796,6 @@ function runFixedLengthDraw(options) {
|
|
|
2728
2796
|
if (rule) required = rule.minimumUserPoints;
|
|
2729
2797
|
else if (typeof min === "number" && typeof max === "number" && min === max) required = min;
|
|
2730
2798
|
else throw new Error(`runFixedLengthDraw: kind "${kind}" is not fixed-length (min=${min}, max=${max})`);
|
|
2731
|
-
const renderOpts = {
|
|
2732
|
-
graphicsStyle,
|
|
2733
|
-
symbolColors
|
|
2734
|
-
};
|
|
2735
2799
|
const guideEnabled = (guideOpt ?? true) && !shouldSuppressGuide(metadata);
|
|
2736
2800
|
const isAreaKind = metadata.geometry === "area";
|
|
2737
2801
|
const initialPoints = [];
|
|
@@ -3000,7 +3064,7 @@ const PREVIEW_CURSOR = "crosshair";
|
|
|
3000
3064
|
* added point again" as additional gesture-level commit triggers.
|
|
3001
3065
|
*/
|
|
3002
3066
|
function runVariableLengthDraw(options) {
|
|
3003
|
-
const { adapter, kind, previewLayer, guideLayer,
|
|
3067
|
+
const { adapter, kind, previewLayer, guideLayer, renderOptions: renderOpts, generateId, signal, onSession, seed, measureOptions, measureStyle, measureProperties, measureTextAmplifiers, guide: guideOpt, sizeAnchor, onSettled, snap } = options;
|
|
3004
3068
|
const metadata = getControlMeasureMetadata(kind);
|
|
3005
3069
|
if (typeof metadata.minCoordinates !== "number") throw new Error(`runVariableLengthDraw: kind "${kind}" has no minCoordinates metadata`);
|
|
3006
3070
|
const min = metadata.minCoordinates;
|
|
@@ -3018,10 +3082,6 @@ function runVariableLengthDraw(options) {
|
|
|
3018
3082
|
function insertionIndex(len) {
|
|
3019
3083
|
return canonicalFormed(len) ? len - trailingFixed : len;
|
|
3020
3084
|
}
|
|
3021
|
-
const renderOpts = {
|
|
3022
|
-
graphicsStyle,
|
|
3023
|
-
symbolColors
|
|
3024
|
-
};
|
|
3025
3085
|
const initialPoints = [];
|
|
3026
3086
|
if (seed) {
|
|
3027
3087
|
for (const pos of seed) {
|
|
@@ -4652,11 +4712,7 @@ const ALLOWED_EDIT_MODES = new Set([
|
|
|
4652
4712
|
* - close / abort / signal / preempt / destroy paths
|
|
4653
4713
|
*/
|
|
4654
4714
|
function runEdit(opts) {
|
|
4655
|
-
const { adapter, measure, graphicsLayer, previewLayer, guideLayer, handlesLayer,
|
|
4656
|
-
const renderOpts = {
|
|
4657
|
-
graphicsStyle,
|
|
4658
|
-
symbolColors
|
|
4659
|
-
};
|
|
4715
|
+
const { adapter, measure, graphicsLayer, previewLayer, guideLayer, handlesLayer, renderOptions: renderOpts, signal, closeOnClickAway = true, modes: initialModes, interactionStyle, onSession, handleIdPrefix, guide: guideOpt, settleToGraphics, publishWorkingGraphic, onSettled, onClickAwayGraphicsPick, snap, deferredSnap } = opts;
|
|
4660
4716
|
let sizeAnchor = opts.sizeAnchor ?? defaultSizeAnchor(measure);
|
|
4661
4717
|
let detailHandles = opts.detailHandles ?? false;
|
|
4662
4718
|
const metadata = getControlMeasureMetadata(measure.kind);
|
|
@@ -5956,6 +6012,10 @@ function runEdit(opts) {
|
|
|
5956
6012
|
if (stylesEqual(currentStyle, next.style)) return;
|
|
5957
6013
|
currentStyle = next.style;
|
|
5958
6014
|
renderWorkingGraphic();
|
|
6015
|
+
},
|
|
6016
|
+
refreshPresentation() {
|
|
6017
|
+
if (core.settled) return;
|
|
6018
|
+
renderWorkingGraphic();
|
|
5959
6019
|
}
|
|
5960
6020
|
};
|
|
5961
6021
|
}
|
|
@@ -6479,13 +6539,9 @@ function defaultGroupSizeAnchor(graphics) {
|
|
|
6479
6539
|
* a live session without a session boundary
|
|
6480
6540
|
*/
|
|
6481
6541
|
function runGroupTransform(opts) {
|
|
6482
|
-
const { adapter, capability, imageCapability, markerCapability, graphics, graphicsLayer, previewLayer, handlesLayer,
|
|
6542
|
+
const { adapter, capability, imageCapability, markerCapability, graphics, graphicsLayer, previewLayer, handlesLayer, renderOptions: renderOpts, signal, closeOnClickAway = true, interactionStyle, onSession, handleIdPrefix, publishWorkingGraphics, settleWorkingGraphics, isOnGraphicsLayer, onSettled, onClickAwayGraphicsPick } = opts;
|
|
6483
6543
|
assertCapabilityFor(graphics);
|
|
6484
6544
|
validateHostResources(graphics);
|
|
6485
|
-
const renderOpts = {
|
|
6486
|
-
graphicsStyle,
|
|
6487
|
-
symbolColors
|
|
6488
|
-
};
|
|
6489
6545
|
let sizeAnchor = opts.sizeAnchor ?? defaultGroupSizeAnchor(graphics);
|
|
6490
6546
|
/** Throw synchronously if any graphic in `list` is a point symbol and no capability was supplied. */
|
|
6491
6547
|
function assertCapabilityFor(list) {
|
|
@@ -8664,6 +8720,11 @@ var TacticalDraw = class {
|
|
|
8664
8720
|
ownedLayers;
|
|
8665
8721
|
graphicsStyle;
|
|
8666
8722
|
symbolColors;
|
|
8723
|
+
/**
|
|
8724
|
+
* Render options shared by the graphics layer and every draw, edit and
|
|
8725
|
+
* transform session; `setHighlightAppearance` updates it in place.
|
|
8726
|
+
*/
|
|
8727
|
+
sessionRenderOptions;
|
|
8667
8728
|
labelSizeBand;
|
|
8668
8729
|
labelFit;
|
|
8669
8730
|
defaultInteractionStyle;
|
|
@@ -8788,6 +8849,11 @@ var TacticalDraw = class {
|
|
|
8788
8849
|
this.labelFit = options?.labelFit ?? "shrink";
|
|
8789
8850
|
this.lastViewResolution = adapter.getResolution();
|
|
8790
8851
|
this.graphicsStyle = resolveStyleHints(BUILT_IN_GRAPHICS_STYLE, options?.graphicsStyle, void 0);
|
|
8852
|
+
this.sessionRenderOptions = {
|
|
8853
|
+
graphicsStyle: this.graphicsStyle,
|
|
8854
|
+
symbolColors: this.symbolColors,
|
|
8855
|
+
highlightAppearance: { ...options?.highlightAppearance }
|
|
8856
|
+
};
|
|
8791
8857
|
this.defaultInteractionStyle = options?.interactionStyle;
|
|
8792
8858
|
this.generateId = options?.generateId ?? (() => `td-${++this.idCounter}`);
|
|
8793
8859
|
this.pointSymbols = options?.pointSymbols;
|
|
@@ -8896,6 +8962,31 @@ var TacticalDraw = class {
|
|
|
8896
8962
|
this.invalidateGraphicGroupCache(false);
|
|
8897
8963
|
if (this.hasRendered) this.reconcileGraphicsStack();
|
|
8898
8964
|
}
|
|
8965
|
+
/** The current app-wide Highlight appearance; see {@link setHighlightAppearance}. */
|
|
8966
|
+
getHighlightAppearance() {
|
|
8967
|
+
return { ...this.sessionRenderOptions.highlightAppearance };
|
|
8968
|
+
}
|
|
8969
|
+
/**
|
|
8970
|
+
* Change how highlighted graphics look (ADR-0062), merging `patch` into the
|
|
8971
|
+
* current appearance: a field set to `undefined` returns to its default.
|
|
8972
|
+
* Re-renders the graphics layer and any graphic being drawn, edited or
|
|
8973
|
+
* transformed; a no-op when nothing changes. See
|
|
8974
|
+
* {@link TacticalDrawOptions.highlightAppearance}.
|
|
8975
|
+
*/
|
|
8976
|
+
setHighlightAppearance(patch) {
|
|
8977
|
+
this.assertAlive();
|
|
8978
|
+
const next = {
|
|
8979
|
+
...this.sessionRenderOptions.highlightAppearance,
|
|
8980
|
+
...patch
|
|
8981
|
+
};
|
|
8982
|
+
for (const key of Object.keys(next)) if (next[key] === void 0) delete next[key];
|
|
8983
|
+
if (deepEqual(next, this.sessionRenderOptions.highlightAppearance)) return;
|
|
8984
|
+
this.sessionRenderOptions.highlightAppearance = next;
|
|
8985
|
+
if (this.graphicsStyle.highlight === true) this.invalidateGraphicGroupCache(false);
|
|
8986
|
+
else for (const graphic of this.lastRenderedMeasures) if (!isAnchoredGraphic(graphic) && graphic.style?.highlight === true) this.graphicGroupCache.delete(graphic);
|
|
8987
|
+
if (this.hasRendered) this.reconcileGraphicsStack();
|
|
8988
|
+
this.refreshActiveEditPresentation();
|
|
8989
|
+
}
|
|
8899
8990
|
/** Replace snapping configuration without recreating the map adapter or façade. */
|
|
8900
8991
|
setSnappingOptions(options) {
|
|
8901
8992
|
this.assertAlive();
|
|
@@ -9007,8 +9098,7 @@ var TacticalDraw = class {
|
|
|
9007
9098
|
};
|
|
9008
9099
|
}
|
|
9009
9100
|
const render = renderMeasureForAdapter(this.adapter, graphic, {
|
|
9010
|
-
|
|
9011
|
-
symbolColors: this.symbolColors,
|
|
9101
|
+
...this.sessionRenderOptions,
|
|
9012
9102
|
context: { labelFit: this.labelFit }
|
|
9013
9103
|
});
|
|
9014
9104
|
return {
|
|
@@ -9479,8 +9569,7 @@ var TacticalDraw = class {
|
|
|
9479
9569
|
kind,
|
|
9480
9570
|
previewLayer: this.previewLayer,
|
|
9481
9571
|
guideLayer: this.guideLayer,
|
|
9482
|
-
|
|
9483
|
-
symbolColors: this.symbolColors,
|
|
9572
|
+
renderOptions: this.sessionRenderOptions,
|
|
9484
9573
|
generateId: () => measureDraft.id ?? this.generateId(),
|
|
9485
9574
|
signal: options?.signal,
|
|
9486
9575
|
measureOptions: measureDraft.options,
|
|
@@ -9498,8 +9587,7 @@ var TacticalDraw = class {
|
|
|
9498
9587
|
kind,
|
|
9499
9588
|
previewLayer: this.previewLayer,
|
|
9500
9589
|
guideLayer: this.guideLayer,
|
|
9501
|
-
|
|
9502
|
-
symbolColors: this.symbolColors,
|
|
9590
|
+
renderOptions: this.sessionRenderOptions,
|
|
9503
9591
|
generateId: () => measureDraft.id ?? this.generateId(),
|
|
9504
9592
|
signal: options?.signal,
|
|
9505
9593
|
onSession: this.trackSession(options?.onSession),
|
|
@@ -9662,8 +9750,7 @@ var TacticalDraw = class {
|
|
|
9662
9750
|
previewLayer: this.previewLayer,
|
|
9663
9751
|
guideLayer: this.guideLayer,
|
|
9664
9752
|
handlesLayer: this.handlesLayer,
|
|
9665
|
-
|
|
9666
|
-
symbolColors: this.symbolColors,
|
|
9753
|
+
renderOptions: this.sessionRenderOptions,
|
|
9667
9754
|
labelSizeBand: this.labelSizeBand,
|
|
9668
9755
|
signal: options?.signal,
|
|
9669
9756
|
closeOnClickAway: options?.closeOnClickAway,
|
|
@@ -9723,8 +9810,7 @@ var TacticalDraw = class {
|
|
|
9723
9810
|
graphicsLayer: this.graphicsLayer,
|
|
9724
9811
|
previewLayer: this.previewLayer,
|
|
9725
9812
|
handlesLayer: this.handlesLayer,
|
|
9726
|
-
|
|
9727
|
-
symbolColors: this.symbolColors,
|
|
9813
|
+
renderOptions: this.sessionRenderOptions,
|
|
9728
9814
|
signal: options?.signal,
|
|
9729
9815
|
closeOnClickAway: options?.closeOnClickAway,
|
|
9730
9816
|
interactionStyle: mergedInteractionStyle,
|
|
@@ -10532,4 +10618,4 @@ function nearestWorldCopyPosition(position, refLng) {
|
|
|
10532
10618
|
return [nearestWorldCopyLng(position[0], refLng), ...position.slice(1)];
|
|
10533
10619
|
}
|
|
10534
10620
|
//#endregion
|
|
10535
|
-
export { BaseMapAdapter, DEFAULT_LABEL_SIZE_PIXELS, DEFAULT_MARKER_SIZE, DEFAULT_PIN_PRESENTATION, DEFAULT_TEXT_SIZE_MAX_PIXELS, DEFAULT_TEXT_SIZE_MIN_PIXELS, HATCH_PATTERNS, HIGHLIGHT_CASING_OUTSET_CSS_PIXELS, ImageCapabilityRequiredError, MINE_PATTERN_TILE_SIZE, MarkerCapabilityRequiredError, PinPresentationStore, PointSymbolCapabilityRequiredError, PointerCallbackHub, TEXT_FADE_END_RATIO, TEXT_HALO_BREAKPOINT_PIXELS, TEXT_HALO_COLOR, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, TacticalDrawDestroyedError, alignPointSymbolIndicator, bindAbortable, cloneImageGraphic, cloneMarker, clonePointSymbol, coerceHandleStyle, combinePinScale, combineWithHostSignal, convertPointSymbolPlacement, effectivePointSymbolPixelSize, evaluatePickCandidates, fillPatternImageDimension, fillPatternImageId, getSizeAnchor, hasHighlightCasing, highlightCasingWidth, hitTestFeature, hitTestIconFeature, ignoreAbort, imageFootprint, imageOpacity, isAnchoredGraphic, isImageGraphic, isMarker, isMinePattern, isPinnableGraphic, isPointSymbol, isTacticalDrawAbortError, isValidPinNumber, makeFillPatternImage, markerFootprint, markerOpacity, mergeNativeAndCachedPickFeatures, movePointSymbolLocation, nearestWorldCopyLng, nearestWorldCopyPosition, normalizeImageGraphic, normalizeMarker, parseColor, pickHitTolerance, pickPointerType, pinDistanceScale, pinZoomScale, placePointSymbol, pointSymbolFootprint, pointSymbolResource, renderOrderToVisualOrder, resizePointSymbolSize, resolveGroundTextSizePixels, resolveHighlightCasing, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
|
|
10621
|
+
export { BaseMapAdapter, DEFAULT_LABEL_SIZE_PIXELS, DEFAULT_MARKER_SIZE, DEFAULT_PIN_PRESENTATION, DEFAULT_TEXT_SIZE_MAX_PIXELS, DEFAULT_TEXT_SIZE_MIN_PIXELS, HATCH_PATTERNS, HIGHLIGHT_BAND_SLOTS, HIGHLIGHT_CASING_OUTSET_CSS_PIXELS, HIGHLIGHT_GLOW_BANDS, ImageCapabilityRequiredError, MINE_PATTERN_TILE_SIZE, MarkerCapabilityRequiredError, PinPresentationStore, PointSymbolCapabilityRequiredError, PointerCallbackHub, TEXT_FADE_END_RATIO, TEXT_HALO_BREAKPOINT_PIXELS, TEXT_HALO_COLOR, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, TacticalDrawDestroyedError, alignPointSymbolIndicator, bindAbortable, cloneImageGraphic, cloneMarker, clonePointSymbol, coerceHandleStyle, combinePinScale, combineWithHostSignal, convertPointSymbolPlacement, effectivePointSymbolPixelSize, evaluatePickCandidates, fillPatternImageDimension, fillPatternImageId, getSizeAnchor, hasHighlightCasing, highlightBandsForStyle, highlightBandsInPaintOrder, highlightCasingWidth, hitTestFeature, hitTestIconFeature, ignoreAbort, imageFootprint, imageOpacity, isAnchoredGraphic, isImageGraphic, isMarker, isMinePattern, isPinnableGraphic, isPointSymbol, isTacticalDrawAbortError, isValidPinNumber, makeFillPatternImage, markerFootprint, markerOpacity, mergeNativeAndCachedPickFeatures, movePointSymbolLocation, nearestWorldCopyLng, nearestWorldCopyPosition, normalizeImageGraphic, normalizeMarker, parseColor, pickHitTolerance, pickPointerType, pinDistanceScale, pinZoomScale, placePointSymbol, pointSymbolFootprint, pointSymbolResource, renderOrderToVisualOrder, resizePointSymbolSize, resolveGroundTextSizePixels, resolveHighlightBands, resolveHighlightCasing, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
|
|
@@ -507,6 +507,19 @@ interface HandleStyle {
|
|
|
507
507
|
* with the transient selection highlight of `setHighlightedGraphics`.
|
|
508
508
|
*/
|
|
509
509
|
highlightColor?: string;
|
|
510
|
+
/**
|
|
511
|
+
* Casing reach past each side of the stroke in CSS pixels (the renderer's
|
|
512
|
+
* resolved `HighlightAppearance.width`); absent means
|
|
513
|
+
* `HIGHLIGHT_CASING_OUTSET_CSS_PIXELS`, and `0` paints no casing.
|
|
514
|
+
*/
|
|
515
|
+
highlightWidth?: number;
|
|
516
|
+
/**
|
|
517
|
+
* Glow reach past the casing in CSS pixels (the renderer's resolved
|
|
518
|
+
* `HighlightAppearance.glow`); absent means no glow. Adapters paint the
|
|
519
|
+
* `HIGHLIGHT_GLOW_BANDS` beneath every casing of the group, as plain
|
|
520
|
+
* translucent strokes. Display-only like the casing.
|
|
521
|
+
*/
|
|
522
|
+
highlightGlow?: number;
|
|
510
523
|
}
|
|
511
524
|
type LayerId = string;
|
|
512
525
|
/** Canonical SVG resource shared by point features through `iconId`. */
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as LayerId, o as MapAdapter, p as PixelCoordinate } from "./map-adapter-
|
|
1
|
+
import { a as LayerId, o as MapAdapter, p as PixelCoordinate } from "./map-adapter-Btuz2FLI.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.
|
|
3
|
+
"version": "0.22.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",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@orbat-mapper/control-measures": "^0.
|
|
42
|
+
"@orbat-mapper/control-measures": "^0.38.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"vitest": ">=4.0.0"
|