@orbat-mapper/tactical-draw 0.17.1 → 0.18.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 { A as PinOverridePatch, B as isValidPinNumber, C as makeFillPatternImage, D as PointerEventInfo, E as PointerCallback, F as PinPresentationStatus, H as pinZoomScale, I as PinPresentationStatusEvent, L as PinPresentationStore, M as PinPresentationCapability, N as PinPresentationPatch, O as DEFAULT_PIN_PRESENTATION, P as PinPresentationState, R as PinRender, S as isMinePattern, T as EditPointerDriver, U as resolvePinPresentation, V as pinDistanceScale, _ as HatchPattern, a as LayerId, b as fillPatternImageDimension, c as MapEvent, d as PickHandler, f as PickOptions, g as HATCH_PATTERNS, h as TextStyleOptions, i as ImageOverlayResource, j as PinPresentation, k as PinFootprint, l as MapEventHandler, m as StyleOptions, n as HandleStyle, o as MapAdapter, p as PixelCoordinate, r as IconResource, s as MapCursor, t as FeatureGroup, u as PickEvent, v as MINE_PATTERN_TILE_SIZE, w as parseColor, x as fillPatternImageId, y as Rgba, z as combinePinScale } from "./map-adapter-
|
|
2
|
-
import { AmplifierPlacement, AmplifierPlacements, ControlMeasure, ControlMeasureKind, ControlMeasureRender, ControlMeasureStyle, SymbolColors, TextAmplifiers } from "@orbat-mapper/control-measures";
|
|
1
|
+
import { A as PinOverridePatch, B as isValidPinNumber, C as makeFillPatternImage, D as PointerEventInfo, E as PointerCallback, F as PinPresentationStatus, H as pinZoomScale, I as PinPresentationStatusEvent, L as PinPresentationStore, M as PinPresentationCapability, N as PinPresentationPatch, O as DEFAULT_PIN_PRESENTATION, P as PinPresentationState, R as PinRender, S as isMinePattern, T as EditPointerDriver, U as resolvePinPresentation, V as pinDistanceScale, _ as HatchPattern, a as LayerId, b as fillPatternImageDimension, c as MapEvent, d as PickHandler, f as PickOptions, g as HATCH_PATTERNS, h as TextStyleOptions, i as ImageOverlayResource, j as PinPresentation, k as PinFootprint, l as MapEventHandler, m as StyleOptions, n as HandleStyle, o as MapAdapter, p as PixelCoordinate, r as IconResource, s as MapCursor, t as FeatureGroup, u as PickEvent, v as MINE_PATTERN_TILE_SIZE, w as parseColor, x as fillPatternImageId, y as Rgba, z as combinePinScale } from "./map-adapter-Cos4xrCn.mjs";
|
|
2
|
+
import { AmplifierPlacement, AmplifierPlacements, ControlMeasure, ControlMeasureKind, ControlMeasureRender, ControlMeasureStyle, 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
|
|
@@ -218,27 +218,36 @@ declare function resolvePickPresentation(feature: Feature, layerStyle?: StyleOpt
|
|
|
218
218
|
* when missing or shaped wrong so callers fall through to the layer style.
|
|
219
219
|
*/
|
|
220
220
|
declare function coerceHandleStyle(raw: unknown): HandleStyle | undefined;
|
|
221
|
-
/**
|
|
222
|
-
|
|
223
|
-
|
|
221
|
+
/**
|
|
222
|
+
* Default lower edge of the ground-anchored label band (ADR-0060): below it a
|
|
223
|
+
* label fades out and hides on the map, rather than pinning.
|
|
224
|
+
*/
|
|
225
|
+
declare const DEFAULT_TEXT_SIZE_MIN_PIXELS = 4;
|
|
226
|
+
/** Default upper edge of the ground-anchored label band (ADR-0028): labels pin here. */
|
|
224
227
|
declare const DEFAULT_TEXT_SIZE_MAX_PIXELS = 24;
|
|
225
228
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
229
|
+
* Share of the band minimum at which a fading ground label reaches zero
|
|
230
|
+
* opacity and hides (ADR-0060): 4 px fades out to nothing at 3.2 px.
|
|
231
|
+
*/
|
|
232
|
+
declare const TEXT_FADE_END_RATIO = 0.8;
|
|
233
|
+
/**
|
|
234
|
+
* Ground label size `textSizeMeters / resolution`, pinned to both edges of
|
|
235
|
+
* the band. The fixed-scale rule behind [[resolveTextAppearance]]'s
|
|
236
|
+
* `pinBelowMinimum` policy; on an interactive map labels hide below the
|
|
237
|
+
* minimum instead.
|
|
234
238
|
*/
|
|
235
239
|
declare function resolveGroundTextSizePixels(textSizeMeters: number, resolution: number, text?: Pick<TextStyleOptions, "textSizeMinPixels" | "textSizeMaxPixels">): number;
|
|
236
240
|
/**
|
|
237
|
-
* The
|
|
238
|
-
*
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
* The ground-anchored label band a host sets on a layer's text style
|
|
242
|
+
* (ADR-0060): labels pin at the maximum and fade out below the minimum.
|
|
243
|
+
*/
|
|
244
|
+
type LabelSizeBand = Pick<TextStyleOptions, "textSizeMinPixels" | "textSizeMaxPixels">;
|
|
245
|
+
/**
|
|
246
|
+
* The size properties a label feature carries (see `FeaturePartProps`).
|
|
247
|
+
* Mutually exclusive size anchors: `textSizePixels` (screen-anchored) or
|
|
248
|
+
* `textSizeMeters` (ground-anchored). `textMaxSizePixels` is the Text
|
|
249
|
+
* graphic's hide threshold (ADR-0037); the min/max band fields are the
|
|
250
|
+
* layer's amplifier-label band, applied only when no threshold is present.
|
|
242
251
|
*/
|
|
243
252
|
interface TextSizeProps {
|
|
244
253
|
textSizeMeters?: number;
|
|
@@ -247,23 +256,34 @@ interface TextSizeProps {
|
|
|
247
256
|
textSizeMinPixels?: number;
|
|
248
257
|
textSizeMaxPixels?: number;
|
|
249
258
|
}
|
|
259
|
+
/** How a label renders this frame: its pixel size and its fade opacity. */
|
|
260
|
+
interface TextAppearance {
|
|
261
|
+
sizePixels: number;
|
|
262
|
+
/** `1` except while a ground label fades out below the band minimum. */
|
|
263
|
+
opacity: number;
|
|
264
|
+
}
|
|
250
265
|
/**
|
|
251
|
-
* Resolve a
|
|
252
|
-
* `
|
|
253
|
-
* signal — when the graphic should render no text this frame; adapters emit no
|
|
254
|
-
* text style for a `null`. Distinct from [[resolveGroundTextSizePixels]], which
|
|
255
|
-
* keeps the 8–24 px clamp band for amplifier labels: this helper is the Text
|
|
256
|
-
* graphic's own sizing rule.
|
|
266
|
+
* Resolve how a label renders on an interactive map at `resolution`, or
|
|
267
|
+
* `null` when it should render nothing this frame:
|
|
257
268
|
*
|
|
258
|
-
* - screen-anchored (`textSizePixels`): the fixed pixel size, never scaled
|
|
259
|
-
* hidden by zoom.
|
|
260
|
-
* - ground-anchored
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
269
|
+
* - screen-anchored (`textSizePixels`): the fixed pixel size, never scaled
|
|
270
|
+
* or hidden by zoom.
|
|
271
|
+
* - ground-anchored with a `textMaxSizePixels` threshold (the Text graphic,
|
|
272
|
+
* ADR-0037): unclamped `meters / resolution`, hidden once that exceeds the
|
|
273
|
+
* threshold. No minimum.
|
|
274
|
+
* - ground-anchored without a threshold (amplifier labels, ADR-0060): scales
|
|
275
|
+
* with its graphic, pinned at the band maximum when zoomed in. Below the
|
|
276
|
+
* band minimum it keeps shrinking while its opacity fades to zero at
|
|
277
|
+
* [[TEXT_FADE_END_RATIO]] × the minimum, then hides. A visible label never
|
|
278
|
+
* stops scaling on the zoom-out side, so it cannot outgrow its area.
|
|
279
|
+
* With `pinBelowMinimum` it pins at the minimum instead: the fixed-scale
|
|
280
|
+
* rule of a printed map sheet, where a label must not vanish.
|
|
265
281
|
* - no usable size or resolution: `null`.
|
|
266
282
|
*/
|
|
283
|
+
declare function resolveTextAppearance(props: TextSizeProps, resolution: number, policy?: {
|
|
284
|
+
pinBelowMinimum?: boolean;
|
|
285
|
+
}): TextAppearance | null;
|
|
286
|
+
/** The pixel size from [[resolveTextAppearance]], or `null` when hidden. */
|
|
267
287
|
declare function resolveTextSizePixels(props: TextSizeProps, resolution: number): number | null;
|
|
268
288
|
/** Fallback halo color when a `textHalo` feature carries no `textHaloColor`. */
|
|
269
289
|
declare const TEXT_HALO_COLOR = "#ffffff";
|
|
@@ -274,6 +294,13 @@ declare const TEXT_HALO_COLOR = "#ffffff";
|
|
|
274
294
|
* one must double this value to get the same visible depth.
|
|
275
295
|
*/
|
|
276
296
|
declare function resolveTextHaloWidth(textSizePixels?: number): number;
|
|
297
|
+
/**
|
|
298
|
+
* Text sizes (px) where `resolveTextHaloWidth` switches between its pieces:
|
|
299
|
+
* below the first the halo shrinks with tiny text, between them it holds at
|
|
300
|
+
* its floor, above the second it grows with the text. Engines that ramp the
|
|
301
|
+
* halo natively (MapLibre) put a stop at each so interpolation stays exact.
|
|
302
|
+
*/
|
|
303
|
+
declare const TEXT_HALO_BREAKPOINT_PIXELS: readonly [number, number];
|
|
277
304
|
//#endregion
|
|
278
305
|
//#region src/gestures/hit-test.d.ts
|
|
279
306
|
type ToPixel = (lonLat: Position) => PixelCoordinate | null;
|
|
@@ -1561,6 +1588,25 @@ interface TacticalDrawOptions {
|
|
|
1561
1588
|
graphicsStyle?: ControlMeasureStyle;
|
|
1562
1589
|
/** Doctrinal defaults; explicit style colors take precedence. */
|
|
1563
1590
|
symbolColors?: SymbolColors;
|
|
1591
|
+
/**
|
|
1592
|
+
* Pixel band for ground-anchored labels on the graphics and preview layers
|
|
1593
|
+
* (ADR-0060). A label stops growing at `textSizeMaxPixels` (default 24) and,
|
|
1594
|
+
* below `textSizeMinPixels` (default 4), fades out and hides so it never
|
|
1595
|
+
* outgrows the area it names. `textSizeMinPixels: 0` never hides a label.
|
|
1596
|
+
* Label selection boxes follow the same band.
|
|
1597
|
+
*/
|
|
1598
|
+
labelSizeBand?: LabelSizeBand;
|
|
1599
|
+
/**
|
|
1600
|
+
* What a screen-anchored area label on the graphics layer does once the
|
|
1601
|
+
* view zooms out far enough that it no longer fits inside its area
|
|
1602
|
+
* (ADR-0061). `"shrink"` shrinks the label with its area, then fades it out
|
|
1603
|
+
* within `labelSizeBand` like a ground-anchored label. `"hide"` leaves out
|
|
1604
|
+
* the rows that don't fit, lowest priority first (W1, W, H, then the name).
|
|
1605
|
+
* `"overflow"` always renders them at their pixel size. The graphic being
|
|
1606
|
+
* edited always shows every row at its pixel size.
|
|
1607
|
+
* @default "shrink"
|
|
1608
|
+
*/
|
|
1609
|
+
labelFit?: LabelFit;
|
|
1564
1610
|
/**
|
|
1565
1611
|
* Façade-level default interaction-affordance style. Per-slot, per-property
|
|
1566
1612
|
* merged with `DrawOptions.interactionStyle` / `EditOptions.interactionStyle`
|
|
@@ -1736,6 +1782,8 @@ declare class TacticalDraw {
|
|
|
1736
1782
|
private readonly ownedLayers;
|
|
1737
1783
|
private readonly graphicsStyle;
|
|
1738
1784
|
private readonly symbolColors;
|
|
1785
|
+
private readonly labelSizeBand;
|
|
1786
|
+
private labelFit;
|
|
1739
1787
|
private readonly defaultInteractionStyle;
|
|
1740
1788
|
private readonly generateId;
|
|
1741
1789
|
private offsetDragModifier;
|
|
@@ -1874,6 +1922,12 @@ declare class TacticalDraw {
|
|
|
1874
1922
|
private graphicUsesPinPresentation;
|
|
1875
1923
|
/** Change the default shortcut for subsequent drags, including in an active edit. */
|
|
1876
1924
|
setOffsetDragModifier(modifier: OffsetDragModifier | false): void;
|
|
1925
|
+
/**
|
|
1926
|
+
* Change what screen-anchored area labels do once they no longer fit their
|
|
1927
|
+
* area (ADR-0061), re-rendering the graphics layer. See
|
|
1928
|
+
* {@link TacticalDrawOptions.labelFit}.
|
|
1929
|
+
*/
|
|
1930
|
+
setLabelFit(labelFit: LabelFit): void;
|
|
1877
1931
|
/** Replace snapping configuration without recreating the map adapter or façade. */
|
|
1878
1932
|
setSnappingOptions(options?: SnappingOptions): void;
|
|
1879
1933
|
/** Clear transient host affordances when snapping or its interaction ends. */
|
|
@@ -2373,4 +2427,4 @@ declare function nearestWorldCopyLng(lng: number, refLng: number): number;
|
|
|
2373
2427
|
/** `nearestWorldCopyLng` applied to a lon/lat position. */
|
|
2374
2428
|
declare function nearestWorldCopyPosition(position: Position, refLng: number): Position;
|
|
2375
2429
|
//#endregion
|
|
2376
|
-
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, type HandleStyle, type HatchPattern, 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 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 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_HALO_COLOR, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, type TacticalDrawAbortReason, TacticalDrawDestroyedError, type TacticalDrawLayerOptions, type TacticalDrawOptions, 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, 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, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
|
|
2430
|
+
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, type HandleStyle, type HatchPattern, 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 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, 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, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
|
package/dist/index.mjs
CHANGED
|
@@ -646,51 +646,79 @@ function coerceHandleStyle(raw) {
|
|
|
646
646
|
if (!raw || typeof raw !== "object") return void 0;
|
|
647
647
|
return raw;
|
|
648
648
|
}
|
|
649
|
-
/**
|
|
650
|
-
|
|
651
|
-
|
|
649
|
+
/**
|
|
650
|
+
* Default lower edge of the ground-anchored label band (ADR-0060): below it a
|
|
651
|
+
* label fades out and hides on the map, rather than pinning.
|
|
652
|
+
*/
|
|
653
|
+
const DEFAULT_TEXT_SIZE_MIN_PIXELS = 4;
|
|
654
|
+
/** Default upper edge of the ground-anchored label band (ADR-0028): labels pin here. */
|
|
652
655
|
const DEFAULT_TEXT_SIZE_MAX_PIXELS = 24;
|
|
653
656
|
/**
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
*
|
|
660
|
-
*
|
|
661
|
-
*
|
|
657
|
+
* Share of the band minimum at which a fading ground label reaches zero
|
|
658
|
+
* opacity and hides (ADR-0060): 4 px fades out to nothing at 3.2 px.
|
|
659
|
+
*/
|
|
660
|
+
const TEXT_FADE_END_RATIO = .8;
|
|
661
|
+
/**
|
|
662
|
+
* Ground label size `textSizeMeters / resolution`, pinned to both edges of
|
|
663
|
+
* the band. The fixed-scale rule behind [[resolveTextAppearance]]'s
|
|
664
|
+
* `pinBelowMinimum` policy; on an interactive map labels hide below the
|
|
665
|
+
* minimum instead.
|
|
662
666
|
*/
|
|
663
667
|
function resolveGroundTextSizePixels(textSizeMeters, resolution, text) {
|
|
664
|
-
const min = text?.textSizeMinPixels ??
|
|
668
|
+
const min = text?.textSizeMinPixels ?? 4;
|
|
665
669
|
const max = text?.textSizeMaxPixels ?? 24;
|
|
666
670
|
return Math.min(max, Math.max(min, textSizeMeters / resolution));
|
|
667
671
|
}
|
|
668
672
|
/**
|
|
669
|
-
* Resolve a
|
|
670
|
-
* `
|
|
671
|
-
* signal — when the graphic should render no text this frame; adapters emit no
|
|
672
|
-
* text style for a `null`. Distinct from [[resolveGroundTextSizePixels]], which
|
|
673
|
-
* keeps the 8–24 px clamp band for amplifier labels: this helper is the Text
|
|
674
|
-
* graphic's own sizing rule.
|
|
673
|
+
* Resolve how a label renders on an interactive map at `resolution`, or
|
|
674
|
+
* `null` when it should render nothing this frame:
|
|
675
675
|
*
|
|
676
|
-
* - screen-anchored (`textSizePixels`): the fixed pixel size, never scaled
|
|
677
|
-
* hidden by zoom.
|
|
678
|
-
* - ground-anchored
|
|
679
|
-
*
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
*
|
|
676
|
+
* - screen-anchored (`textSizePixels`): the fixed pixel size, never scaled
|
|
677
|
+
* or hidden by zoom.
|
|
678
|
+
* - ground-anchored with a `textMaxSizePixels` threshold (the Text graphic,
|
|
679
|
+
* ADR-0037): unclamped `meters / resolution`, hidden once that exceeds the
|
|
680
|
+
* threshold. No minimum.
|
|
681
|
+
* - ground-anchored without a threshold (amplifier labels, ADR-0060): scales
|
|
682
|
+
* with its graphic, pinned at the band maximum when zoomed in. Below the
|
|
683
|
+
* band minimum it keeps shrinking while its opacity fades to zero at
|
|
684
|
+
* [[TEXT_FADE_END_RATIO]] × the minimum, then hides. A visible label never
|
|
685
|
+
* stops scaling on the zoom-out side, so it cannot outgrow its area.
|
|
686
|
+
* With `pinBelowMinimum` it pins at the minimum instead: the fixed-scale
|
|
687
|
+
* rule of a printed map sheet, where a label must not vanish.
|
|
683
688
|
* - no usable size or resolution: `null`.
|
|
684
689
|
*/
|
|
685
|
-
function
|
|
686
|
-
if (typeof props.textSizePixels === "number") return
|
|
690
|
+
function resolveTextAppearance(props, resolution, policy) {
|
|
691
|
+
if (typeof props.textSizePixels === "number") return {
|
|
692
|
+
sizePixels: props.textSizePixels,
|
|
693
|
+
opacity: 1
|
|
694
|
+
};
|
|
687
695
|
const meters = props.textSizeMeters;
|
|
688
696
|
if (typeof meters !== "number" || !(resolution > 0)) return null;
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
697
|
+
const px = meters / resolution;
|
|
698
|
+
if (typeof props.textMaxSizePixels === "number") return px > props.textMaxSizePixels ? null : {
|
|
699
|
+
sizePixels: px,
|
|
700
|
+
opacity: 1
|
|
701
|
+
};
|
|
702
|
+
if (policy?.pinBelowMinimum) return {
|
|
703
|
+
sizePixels: resolveGroundTextSizePixels(meters, resolution, props),
|
|
704
|
+
opacity: 1
|
|
705
|
+
};
|
|
706
|
+
const min = props.textSizeMinPixels ?? 4;
|
|
707
|
+
const max = props.textSizeMaxPixels ?? 24;
|
|
708
|
+
if (px >= min) return {
|
|
709
|
+
sizePixels: Math.min(max, px),
|
|
710
|
+
opacity: 1
|
|
711
|
+
};
|
|
712
|
+
const fadeEnd = min * TEXT_FADE_END_RATIO;
|
|
713
|
+
if (px <= fadeEnd) return null;
|
|
714
|
+
return {
|
|
715
|
+
sizePixels: px,
|
|
716
|
+
opacity: (px - fadeEnd) / (min - fadeEnd)
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
/** The pixel size from [[resolveTextAppearance]], or `null` when hidden. */
|
|
720
|
+
function resolveTextSizePixels(props, resolution) {
|
|
721
|
+
return resolveTextAppearance(props, resolution)?.sizePixels ?? null;
|
|
694
722
|
}
|
|
695
723
|
/** Fallback halo color when a `textHalo` feature carries no `textHaloColor`. */
|
|
696
724
|
const TEXT_HALO_COLOR = "#ffffff";
|
|
@@ -701,8 +729,19 @@ const TEXT_HALO_COLOR = "#ffffff";
|
|
|
701
729
|
* one must double this value to get the same visible depth.
|
|
702
730
|
*/
|
|
703
731
|
function resolveTextHaloWidth(textSizePixels) {
|
|
704
|
-
|
|
732
|
+
const size = textSizePixels ?? 24;
|
|
733
|
+
return Math.max(size / HALO_SIZE_RATIO, Math.min(HALO_FLOOR, size / TINY_HALO_SIZE_RATIO));
|
|
705
734
|
}
|
|
735
|
+
const HALO_SIZE_RATIO = 8;
|
|
736
|
+
const TINY_HALO_SIZE_RATIO = 5;
|
|
737
|
+
const HALO_FLOOR = 1.5;
|
|
738
|
+
/**
|
|
739
|
+
* Text sizes (px) where `resolveTextHaloWidth` switches between its pieces:
|
|
740
|
+
* below the first the halo shrinks with tiny text, between them it holds at
|
|
741
|
+
* its floor, above the second it grows with the text. Engines that ramp the
|
|
742
|
+
* halo natively (MapLibre) put a stop at each so interpolation stays exact.
|
|
743
|
+
*/
|
|
744
|
+
const TEXT_HALO_BREAKPOINT_PIXELS = [HALO_FLOOR * TINY_HALO_SIZE_RATIO, HALO_FLOOR * HALO_SIZE_RATIO];
|
|
706
745
|
//#endregion
|
|
707
746
|
//#region src/gestures/hit-test.ts
|
|
708
747
|
/** Clamped parameter t ∈ [0, 1] of `pixel` projected onto the segment a→b in pixel space, or null for a zero-length segment. */
|
|
@@ -4085,31 +4124,37 @@ function normalizeAngle(angle) {
|
|
|
4085
4124
|
* times `CHAR_WIDTH_FACTOR × h` gives the width, the line count times
|
|
4086
4125
|
* `LINE_HEIGHT_FACTOR × h` gives the height, where `h` is the resolved
|
|
4087
4126
|
* text-height-in-pixels, mirroring how the adapters render each anchor
|
|
4088
|
-
* kind
|
|
4089
|
-
*
|
|
4090
|
-
*
|
|
4091
|
-
* `
|
|
4092
|
-
* `
|
|
4093
|
-
*
|
|
4094
|
-
* side. Hosts can override the clamp band per layer style
|
|
4095
|
-
* (`TextStyleOptions.textSizeMinPixels`/`textSizeMaxPixels`), which this
|
|
4096
|
-
* estimate can't see — the default band keeps the box honest at extreme
|
|
4097
|
-
* zooms even when a host has customized it.
|
|
4127
|
+
* kind through `resolveTextAppearance` (`feature-style.ts`, ADR-0028,
|
|
4128
|
+
* ADR-0060), with only a `1px` sanity floor to keep the box
|
|
4129
|
+
* non-degenerate: screen-anchored `textSizePixels` as-is; ground-anchored
|
|
4130
|
+
* `textSizeMeters / resolution` within the host's `labelSizeBand`;
|
|
4131
|
+
* absent both, `DEFAULT_LABEL_TEXT_SIZE_PX`. `LABEL_BOX_PADDING_PX` is
|
|
4132
|
+
* added on every side.
|
|
4098
4133
|
* - **Center**: `anchor` for centered text (`textAnchor` absent); offset by
|
|
4099
4134
|
* half the fitted width along the label's local +x for `"start"` (text
|
|
4100
4135
|
* grows away from the anchor) or local −x for `"end"` (text grows back
|
|
4101
4136
|
* toward the anchor) — `rotate()` (`transform-box.ts`) already uses the
|
|
4102
4137
|
* screen (y-down) convention this offset needs.
|
|
4103
|
-
* - **Hidden**: a ground-anchored size past `textMaxSizePixels` (ADR-0037)
|
|
4104
|
-
* returns `null` — the box
|
|
4105
|
-
* rather than keep boxing text
|
|
4138
|
+
* - **Hidden**: a ground-anchored size past `textMaxSizePixels` (ADR-0037),
|
|
4139
|
+
* or faded out below the band minimum (ADR-0060), returns `null` — the box
|
|
4140
|
+
* tracks `resolveTextAppearance`'s hide rule rather than keep boxing text
|
|
4141
|
+
* that no adapter is drawing.
|
|
4106
4142
|
*/
|
|
4107
4143
|
function fitLabelTransformBox(input) {
|
|
4108
|
-
const { text, rotation, textAnchor, textSizePixels, textSizeMeters, anchor, resolution, bearing, unclamped, textMaxSizePixels } = input;
|
|
4144
|
+
const { text, rotation, textAnchor, textSizePixels, textSizeMeters, anchor, resolution, bearing, unclamped, textMaxSizePixels, labelSizeBand } = input;
|
|
4109
4145
|
if (!text) return null;
|
|
4110
|
-
if (typeof textMaxSizePixels === "number" && textSizePixels === void 0 && typeof textSizeMeters === "number" && typeof resolution === "number" && resolution > 0 && textSizeMeters / resolution > textMaxSizePixels) return null;
|
|
4111
4146
|
const angle = normalizeAngle(Math.PI - (rotation ?? 0) - (bearing ?? 0));
|
|
4112
|
-
|
|
4147
|
+
let h = 16;
|
|
4148
|
+
if (textSizePixels !== void 0 || textSizeMeters !== void 0 && resolution !== void 0 && resolution > 0) {
|
|
4149
|
+
const appearance = resolveTextAppearance({
|
|
4150
|
+
textSizePixels,
|
|
4151
|
+
textSizeMeters,
|
|
4152
|
+
textMaxSizePixels: unclamped ? textMaxSizePixels ?? Infinity : textMaxSizePixels,
|
|
4153
|
+
...labelSizeBand
|
|
4154
|
+
}, resolution ?? 0);
|
|
4155
|
+
if (!appearance) return null;
|
|
4156
|
+
h = Math.max(1, appearance.sizePixels);
|
|
4157
|
+
}
|
|
4113
4158
|
const lines = text.split("\n");
|
|
4114
4159
|
const width = lines.reduce((max, line) => Math.max(max, line.length), 0) * CHAR_WIDTH_FACTOR * h;
|
|
4115
4160
|
const height = lines.length * LINE_HEIGHT_FACTOR * h;
|
|
@@ -4148,7 +4193,8 @@ function fitLabelBoxFromFeature(feature, anchorPixel, view) {
|
|
|
4148
4193
|
anchor: anchorPixel,
|
|
4149
4194
|
resolution: view.resolution,
|
|
4150
4195
|
bearing: view.bearing,
|
|
4151
|
-
unclamped: view.unclamped
|
|
4196
|
+
unclamped: view.unclamped,
|
|
4197
|
+
labelSizeBand: view.labelSizeBand
|
|
4152
4198
|
});
|
|
4153
4199
|
}
|
|
4154
4200
|
/**
|
|
@@ -4249,7 +4295,12 @@ function mergeAmplifierPlacementField(existing, incoming) {
|
|
|
4249
4295
|
* its session-owned `workingAmplifierPlacements`.
|
|
4250
4296
|
*/
|
|
4251
4297
|
function createLabelPlacement(deps) {
|
|
4252
|
-
const { projection,
|
|
4298
|
+
const { projection, features, snapshotAmplifierPlacements, handleIdPrefix, interactionStyle, labelSizeBand } = deps;
|
|
4299
|
+
/** The live view plus the fixed band: everything a label box fit needs. */
|
|
4300
|
+
const view = () => ({
|
|
4301
|
+
...deps.view(),
|
|
4302
|
+
labelSizeBand
|
|
4303
|
+
});
|
|
4253
4304
|
/**
|
|
4254
4305
|
* The currently selected label's `labelPlacementKey`, or `null` when no label
|
|
4255
4306
|
* is selected. A click on a label toggles this (select / deselect / switch —
|
|
@@ -4431,7 +4482,7 @@ function createLabelPlacement(deps) {
|
|
|
4431
4482
|
const drag = activeLabelRotateDrag;
|
|
4432
4483
|
const delta = pointerAngleAround(pixel, drag.anchorPixel) - drag.startPointerAngle;
|
|
4433
4484
|
const rotation = drag.startRotation - delta;
|
|
4434
|
-
const { resolution, bearing } = view();
|
|
4485
|
+
const { resolution, bearing } = deps.view();
|
|
4435
4486
|
const liveBox = fitLabelTransformBox({
|
|
4436
4487
|
text: drag.text,
|
|
4437
4488
|
rotation,
|
|
@@ -4440,7 +4491,8 @@ function createLabelPlacement(deps) {
|
|
|
4440
4491
|
textSizeMeters: drag.textSizeMeters,
|
|
4441
4492
|
anchor: drag.anchorPixel,
|
|
4442
4493
|
resolution,
|
|
4443
|
-
bearing
|
|
4494
|
+
bearing,
|
|
4495
|
+
labelSizeBand
|
|
4444
4496
|
});
|
|
4445
4497
|
if (liveBox) drag.lastBox = liveBox;
|
|
4446
4498
|
return {
|
|
@@ -4660,6 +4712,7 @@ function runEdit(opts) {
|
|
|
4660
4712
|
resolution: adapter.getResolution(),
|
|
4661
4713
|
bearing: adapter.getBearing()
|
|
4662
4714
|
}),
|
|
4715
|
+
labelSizeBand: opts.labelSizeBand,
|
|
4663
4716
|
features: () => lastWorkingFeatures,
|
|
4664
4717
|
snapshotAmplifierPlacements,
|
|
4665
4718
|
handleIdPrefix,
|
|
@@ -8537,6 +8590,8 @@ var TacticalDraw = class {
|
|
|
8537
8590
|
ownedLayers;
|
|
8538
8591
|
graphicsStyle;
|
|
8539
8592
|
symbolColors;
|
|
8593
|
+
labelSizeBand;
|
|
8594
|
+
labelFit;
|
|
8540
8595
|
defaultInteractionStyle;
|
|
8541
8596
|
generateId;
|
|
8542
8597
|
offsetDragModifier;
|
|
@@ -8655,6 +8710,8 @@ var TacticalDraw = class {
|
|
|
8655
8710
|
this.adapter = adapter;
|
|
8656
8711
|
this.offsetDragModifier = options?.offsetDragModifier ?? false;
|
|
8657
8712
|
this.symbolColors = options?.symbolColors ? { ...options.symbolColors } : void 0;
|
|
8713
|
+
this.labelSizeBand = options?.labelSizeBand ? { ...options.labelSizeBand } : void 0;
|
|
8714
|
+
this.labelFit = options?.labelFit ?? "shrink";
|
|
8658
8715
|
this.lastViewResolution = adapter.getResolution();
|
|
8659
8716
|
this.graphicsStyle = resolveStyleHints(BUILT_IN_GRAPHICS_STYLE, options?.graphicsStyle, void 0);
|
|
8660
8717
|
this.defaultInteractionStyle = options?.interactionStyle;
|
|
@@ -8676,7 +8733,7 @@ var TacticalDraw = class {
|
|
|
8676
8733
|
this.guideLayer = resolveSlot(adapter, provided.guide, owned);
|
|
8677
8734
|
this.handlesLayer = resolveSlot(adapter, provided.handles, owned);
|
|
8678
8735
|
this.ownedLayers = owned;
|
|
8679
|
-
const graphicsLayerStyle = styleToStyleOptions(this.graphicsStyle);
|
|
8736
|
+
const graphicsLayerStyle = styleToStyleOptions(this.graphicsStyle, this.labelSizeBand);
|
|
8680
8737
|
this.adapter.setLayerStyle(this.graphicsLayer, graphicsLayerStyle);
|
|
8681
8738
|
this.adapter.setLayerStyle(this.previewLayer, graphicsLayerStyle);
|
|
8682
8739
|
this.adapter.setLayerStyle(this.guideLayer, guideToStyleOptions(this.baseGuideStyle()));
|
|
@@ -8745,6 +8802,18 @@ var TacticalDraw = class {
|
|
|
8745
8802
|
this.assertAlive();
|
|
8746
8803
|
this.offsetDragModifier = modifier;
|
|
8747
8804
|
}
|
|
8805
|
+
/**
|
|
8806
|
+
* Change what screen-anchored area labels do once they no longer fit their
|
|
8807
|
+
* area (ADR-0061), re-rendering the graphics layer. See
|
|
8808
|
+
* {@link TacticalDrawOptions.labelFit}.
|
|
8809
|
+
*/
|
|
8810
|
+
setLabelFit(labelFit) {
|
|
8811
|
+
this.assertAlive();
|
|
8812
|
+
if (labelFit === this.labelFit) return;
|
|
8813
|
+
this.labelFit = labelFit;
|
|
8814
|
+
this.invalidateGraphicGroupCache(false);
|
|
8815
|
+
if (this.hasRendered) this.reconcileGraphicsStack();
|
|
8816
|
+
}
|
|
8748
8817
|
/** Replace snapping configuration without recreating the map adapter or façade. */
|
|
8749
8818
|
setSnappingOptions(options) {
|
|
8750
8819
|
this.assertAlive();
|
|
@@ -8854,7 +8923,8 @@ var TacticalDraw = class {
|
|
|
8854
8923
|
}
|
|
8855
8924
|
const render = renderMeasureForAdapter(this.adapter, graphic, {
|
|
8856
8925
|
graphicsStyle: this.graphicsStyle,
|
|
8857
|
-
symbolColors: this.symbolColors
|
|
8926
|
+
symbolColors: this.symbolColors,
|
|
8927
|
+
context: { labelFit: this.labelFit }
|
|
8858
8928
|
});
|
|
8859
8929
|
return {
|
|
8860
8930
|
id: graphic.id,
|
|
@@ -9509,6 +9579,7 @@ var TacticalDraw = class {
|
|
|
9509
9579
|
handlesLayer: this.handlesLayer,
|
|
9510
9580
|
graphicsStyle: this.graphicsStyle,
|
|
9511
9581
|
symbolColors: this.symbolColors,
|
|
9582
|
+
labelSizeBand: this.labelSizeBand,
|
|
9512
9583
|
signal: options?.signal,
|
|
9513
9584
|
closeOnClickAway: options?.closeOnClickAway,
|
|
9514
9585
|
modes: options?.modes,
|
|
@@ -9773,7 +9844,8 @@ var TacticalDraw = class {
|
|
|
9773
9844
|
if (!anchorPixel) continue;
|
|
9774
9845
|
const box = fitLabelBoxFromFeature(feature, anchorPixel, {
|
|
9775
9846
|
resolution: this.adapter.getResolution(),
|
|
9776
|
-
bearing: this.adapter.getBearing()
|
|
9847
|
+
bearing: this.adapter.getBearing(),
|
|
9848
|
+
labelSizeBand: this.labelSizeBand
|
|
9777
9849
|
});
|
|
9778
9850
|
if (box) labelCandidates.push({
|
|
9779
9851
|
feature,
|
|
@@ -10091,14 +10163,17 @@ function mergeSlot(base, override) {
|
|
|
10091
10163
|
else out[k] = v;
|
|
10092
10164
|
return out;
|
|
10093
10165
|
}
|
|
10094
|
-
function styleToStyleOptions(style) {
|
|
10166
|
+
function styleToStyleOptions(style, labelSizeBand) {
|
|
10095
10167
|
const out = {};
|
|
10096
10168
|
const strokeColor = style.strokeColor ?? style.color ?? DEFAULT_SYMBOL_COLOR;
|
|
10097
10169
|
if (strokeColor !== void 0) out.strokeColor = strokeColor;
|
|
10098
10170
|
if (style.strokeWidth !== void 0) out.strokeWidth = style.strokeWidth;
|
|
10099
10171
|
if (style.strokeDash !== void 0) out.strokeDash = [...style.strokeDash];
|
|
10100
10172
|
if (style.fillColor !== void 0) out.fillColor = style.fillColor;
|
|
10101
|
-
out.text = {
|
|
10173
|
+
out.text = {
|
|
10174
|
+
labelProperty: "text",
|
|
10175
|
+
...labelSizeBand
|
|
10176
|
+
};
|
|
10102
10177
|
return out;
|
|
10103
10178
|
}
|
|
10104
10179
|
function guideToStyleOptions(style) {
|
|
@@ -10372,4 +10447,4 @@ function nearestWorldCopyPosition(position, refLng) {
|
|
|
10372
10447
|
return [nearestWorldCopyLng(position[0], refLng), ...position.slice(1)];
|
|
10373
10448
|
}
|
|
10374
10449
|
//#endregion
|
|
10375
|
-
export { BaseMapAdapter, DEFAULT_LABEL_SIZE_PIXELS, DEFAULT_MARKER_SIZE, DEFAULT_PIN_PRESENTATION, DEFAULT_TEXT_SIZE_MAX_PIXELS, DEFAULT_TEXT_SIZE_MIN_PIXELS, HATCH_PATTERNS, ImageCapabilityRequiredError, MINE_PATTERN_TILE_SIZE, MarkerCapabilityRequiredError, PinPresentationStore, PointSymbolCapabilityRequiredError, PointerCallbackHub, TEXT_HALO_COLOR, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, TacticalDrawDestroyedError, alignPointSymbolIndicator, bindAbortable, cloneImageGraphic, cloneMarker, clonePointSymbol, coerceHandleStyle, combinePinScale, combineWithHostSignal, convertPointSymbolPlacement, effectivePointSymbolPixelSize, evaluatePickCandidates, fillPatternImageDimension, fillPatternImageId, getSizeAnchor, 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, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
|
|
10450
|
+
export { BaseMapAdapter, DEFAULT_LABEL_SIZE_PIXELS, DEFAULT_MARKER_SIZE, DEFAULT_PIN_PRESENTATION, DEFAULT_TEXT_SIZE_MAX_PIXELS, DEFAULT_TEXT_SIZE_MIN_PIXELS, HATCH_PATTERNS, 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, 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, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
|
|
@@ -283,9 +283,10 @@ interface StyleOptions {
|
|
|
283
283
|
* `π − rotation`), the size anchor's `textSizeMeters` (ground) or
|
|
284
284
|
* `textSizePixels` (screen) (ADR-0028), and `textAnchor` (`"start"` = text
|
|
285
285
|
* begins at the label point, `"end"` = text ends there; absent = centered).
|
|
286
|
-
* A ground-anchored label renders at
|
|
287
|
-
* `
|
|
288
|
-
* a screen-anchored one at a constant
|
|
286
|
+
* A ground-anchored label renders at `textSizeMeters / resolution`, pinned at
|
|
287
|
+
* `textSizeMaxPixels` and faded out then hidden below `textSizeMinPixels`
|
|
288
|
+
* (`resolveTextAppearance`, ADR-0060); a screen-anchored one at a constant
|
|
289
|
+
* `textSizePixels`, unclamped.
|
|
289
290
|
*/
|
|
290
291
|
interface TextStyleOptions {
|
|
291
292
|
text?: string;
|
|
@@ -296,13 +297,14 @@ interface TextStyleOptions {
|
|
|
296
297
|
strokeWidth?: number;
|
|
297
298
|
rotation?: number;
|
|
298
299
|
/**
|
|
299
|
-
* Lower edge of the ground-anchored label
|
|
300
|
-
*
|
|
301
|
-
*
|
|
300
|
+
* Lower edge of the ground-anchored label band (ADR-0060): zoomed out past
|
|
301
|
+
* it, a label keeps shrinking with its graphic while it fades out, then
|
|
302
|
+
* hides, so it never outgrows the area it names.
|
|
303
|
+
* @default 4
|
|
302
304
|
*/
|
|
303
305
|
textSizeMinPixels?: number;
|
|
304
306
|
/**
|
|
305
|
-
* Upper edge of the ground-anchored label
|
|
307
|
+
* Upper edge of the ground-anchored label band (ADR-0028): text never
|
|
306
308
|
* renders above this pixel size, however far the view zooms in.
|
|
307
309
|
* @default 24
|
|
308
310
|
*/
|
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-Cos4xrCn.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.18.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.35.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"vitest": ">=4.0.0"
|