@orbat-mapper/tactical-draw 0.17.0 → 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. */
|
|
@@ -1493,15 +1532,22 @@ function pixelDistance$1(a, b) {
|
|
|
1493
1532
|
* grip use `tolerance` pixels; body containment is exact (`pointInBox`), so a
|
|
1494
1533
|
* click just outside the box never starts a body drag. Returns `null` when
|
|
1495
1534
|
* nothing matches.
|
|
1535
|
+
*
|
|
1536
|
+
* Inside the box a corner reaches no further than half the shorter
|
|
1537
|
+
* half-extent, so a box smaller than the corners' reach — a small symbol
|
|
1538
|
+
* under a touch tolerance — keeps its middle for the body. Outward a corner
|
|
1539
|
+
* keeps the full tolerance.
|
|
1496
1540
|
*/
|
|
1497
1541
|
function pickBoxHandle(box, pixel, tolerance) {
|
|
1498
1542
|
const corners = boxCorners(box);
|
|
1499
|
-
|
|
1543
|
+
const inside = pointInBox(box, pixel);
|
|
1544
|
+
const reach = inside ? Math.min(tolerance, Math.min(box.halfWidth, box.halfHeight) / 2) : tolerance;
|
|
1545
|
+
for (let i = 0; i < corners.length; i++) if (pixelDistance$1(corners[i], pixel) <= reach) return {
|
|
1500
1546
|
kind: "scale",
|
|
1501
1547
|
index: i
|
|
1502
1548
|
};
|
|
1503
1549
|
if (pixelDistance$1(rotateGripPixel(box), pixel) <= tolerance) return { kind: "rotate" };
|
|
1504
|
-
if (
|
|
1550
|
+
if (inside) return { kind: "body" };
|
|
1505
1551
|
return null;
|
|
1506
1552
|
}
|
|
1507
1553
|
//#endregion
|
|
@@ -4078,31 +4124,37 @@ function normalizeAngle(angle) {
|
|
|
4078
4124
|
* times `CHAR_WIDTH_FACTOR × h` gives the width, the line count times
|
|
4079
4125
|
* `LINE_HEIGHT_FACTOR × h` gives the height, where `h` is the resolved
|
|
4080
4126
|
* text-height-in-pixels, mirroring how the adapters render each anchor
|
|
4081
|
-
* kind
|
|
4082
|
-
*
|
|
4083
|
-
*
|
|
4084
|
-
* `
|
|
4085
|
-
* `
|
|
4086
|
-
*
|
|
4087
|
-
* side. Hosts can override the clamp band per layer style
|
|
4088
|
-
* (`TextStyleOptions.textSizeMinPixels`/`textSizeMaxPixels`), which this
|
|
4089
|
-
* estimate can't see — the default band keeps the box honest at extreme
|
|
4090
|
-
* 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.
|
|
4091
4133
|
* - **Center**: `anchor` for centered text (`textAnchor` absent); offset by
|
|
4092
4134
|
* half the fitted width along the label's local +x for `"start"` (text
|
|
4093
4135
|
* grows away from the anchor) or local −x for `"end"` (text grows back
|
|
4094
4136
|
* toward the anchor) — `rotate()` (`transform-box.ts`) already uses the
|
|
4095
4137
|
* screen (y-down) convention this offset needs.
|
|
4096
|
-
* - **Hidden**: a ground-anchored size past `textMaxSizePixels` (ADR-0037)
|
|
4097
|
-
* returns `null` — the box
|
|
4098
|
-
* 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.
|
|
4099
4142
|
*/
|
|
4100
4143
|
function fitLabelTransformBox(input) {
|
|
4101
|
-
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;
|
|
4102
4145
|
if (!text) return null;
|
|
4103
|
-
if (typeof textMaxSizePixels === "number" && textSizePixels === void 0 && typeof textSizeMeters === "number" && typeof resolution === "number" && resolution > 0 && textSizeMeters / resolution > textMaxSizePixels) return null;
|
|
4104
4146
|
const angle = normalizeAngle(Math.PI - (rotation ?? 0) - (bearing ?? 0));
|
|
4105
|
-
|
|
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
|
+
}
|
|
4106
4158
|
const lines = text.split("\n");
|
|
4107
4159
|
const width = lines.reduce((max, line) => Math.max(max, line.length), 0) * CHAR_WIDTH_FACTOR * h;
|
|
4108
4160
|
const height = lines.length * LINE_HEIGHT_FACTOR * h;
|
|
@@ -4141,7 +4193,8 @@ function fitLabelBoxFromFeature(feature, anchorPixel, view) {
|
|
|
4141
4193
|
anchor: anchorPixel,
|
|
4142
4194
|
resolution: view.resolution,
|
|
4143
4195
|
bearing: view.bearing,
|
|
4144
|
-
unclamped: view.unclamped
|
|
4196
|
+
unclamped: view.unclamped,
|
|
4197
|
+
labelSizeBand: view.labelSizeBand
|
|
4145
4198
|
});
|
|
4146
4199
|
}
|
|
4147
4200
|
/**
|
|
@@ -4242,7 +4295,12 @@ function mergeAmplifierPlacementField(existing, incoming) {
|
|
|
4242
4295
|
* its session-owned `workingAmplifierPlacements`.
|
|
4243
4296
|
*/
|
|
4244
4297
|
function createLabelPlacement(deps) {
|
|
4245
|
-
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
|
+
});
|
|
4246
4304
|
/**
|
|
4247
4305
|
* The currently selected label's `labelPlacementKey`, or `null` when no label
|
|
4248
4306
|
* is selected. A click on a label toggles this (select / deselect / switch —
|
|
@@ -4424,7 +4482,7 @@ function createLabelPlacement(deps) {
|
|
|
4424
4482
|
const drag = activeLabelRotateDrag;
|
|
4425
4483
|
const delta = pointerAngleAround(pixel, drag.anchorPixel) - drag.startPointerAngle;
|
|
4426
4484
|
const rotation = drag.startRotation - delta;
|
|
4427
|
-
const { resolution, bearing } = view();
|
|
4485
|
+
const { resolution, bearing } = deps.view();
|
|
4428
4486
|
const liveBox = fitLabelTransformBox({
|
|
4429
4487
|
text: drag.text,
|
|
4430
4488
|
rotation,
|
|
@@ -4433,7 +4491,8 @@ function createLabelPlacement(deps) {
|
|
|
4433
4491
|
textSizeMeters: drag.textSizeMeters,
|
|
4434
4492
|
anchor: drag.anchorPixel,
|
|
4435
4493
|
resolution,
|
|
4436
|
-
bearing
|
|
4494
|
+
bearing,
|
|
4495
|
+
labelSizeBand
|
|
4437
4496
|
});
|
|
4438
4497
|
if (liveBox) drag.lastBox = liveBox;
|
|
4439
4498
|
return {
|
|
@@ -4653,6 +4712,7 @@ function runEdit(opts) {
|
|
|
4653
4712
|
resolution: adapter.getResolution(),
|
|
4654
4713
|
bearing: adapter.getBearing()
|
|
4655
4714
|
}),
|
|
4715
|
+
labelSizeBand: opts.labelSizeBand,
|
|
4656
4716
|
features: () => lastWorkingFeatures,
|
|
4657
4717
|
snapshotAmplifierPlacements,
|
|
4658
4718
|
handleIdPrefix,
|
|
@@ -8530,6 +8590,8 @@ var TacticalDraw = class {
|
|
|
8530
8590
|
ownedLayers;
|
|
8531
8591
|
graphicsStyle;
|
|
8532
8592
|
symbolColors;
|
|
8593
|
+
labelSizeBand;
|
|
8594
|
+
labelFit;
|
|
8533
8595
|
defaultInteractionStyle;
|
|
8534
8596
|
generateId;
|
|
8535
8597
|
offsetDragModifier;
|
|
@@ -8648,6 +8710,8 @@ var TacticalDraw = class {
|
|
|
8648
8710
|
this.adapter = adapter;
|
|
8649
8711
|
this.offsetDragModifier = options?.offsetDragModifier ?? false;
|
|
8650
8712
|
this.symbolColors = options?.symbolColors ? { ...options.symbolColors } : void 0;
|
|
8713
|
+
this.labelSizeBand = options?.labelSizeBand ? { ...options.labelSizeBand } : void 0;
|
|
8714
|
+
this.labelFit = options?.labelFit ?? "shrink";
|
|
8651
8715
|
this.lastViewResolution = adapter.getResolution();
|
|
8652
8716
|
this.graphicsStyle = resolveStyleHints(BUILT_IN_GRAPHICS_STYLE, options?.graphicsStyle, void 0);
|
|
8653
8717
|
this.defaultInteractionStyle = options?.interactionStyle;
|
|
@@ -8669,7 +8733,7 @@ var TacticalDraw = class {
|
|
|
8669
8733
|
this.guideLayer = resolveSlot(adapter, provided.guide, owned);
|
|
8670
8734
|
this.handlesLayer = resolveSlot(adapter, provided.handles, owned);
|
|
8671
8735
|
this.ownedLayers = owned;
|
|
8672
|
-
const graphicsLayerStyle = styleToStyleOptions(this.graphicsStyle);
|
|
8736
|
+
const graphicsLayerStyle = styleToStyleOptions(this.graphicsStyle, this.labelSizeBand);
|
|
8673
8737
|
this.adapter.setLayerStyle(this.graphicsLayer, graphicsLayerStyle);
|
|
8674
8738
|
this.adapter.setLayerStyle(this.previewLayer, graphicsLayerStyle);
|
|
8675
8739
|
this.adapter.setLayerStyle(this.guideLayer, guideToStyleOptions(this.baseGuideStyle()));
|
|
@@ -8738,6 +8802,18 @@ var TacticalDraw = class {
|
|
|
8738
8802
|
this.assertAlive();
|
|
8739
8803
|
this.offsetDragModifier = modifier;
|
|
8740
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
|
+
}
|
|
8741
8817
|
/** Replace snapping configuration without recreating the map adapter or façade. */
|
|
8742
8818
|
setSnappingOptions(options) {
|
|
8743
8819
|
this.assertAlive();
|
|
@@ -8847,7 +8923,8 @@ var TacticalDraw = class {
|
|
|
8847
8923
|
}
|
|
8848
8924
|
const render = renderMeasureForAdapter(this.adapter, graphic, {
|
|
8849
8925
|
graphicsStyle: this.graphicsStyle,
|
|
8850
|
-
symbolColors: this.symbolColors
|
|
8926
|
+
symbolColors: this.symbolColors,
|
|
8927
|
+
context: { labelFit: this.labelFit }
|
|
8851
8928
|
});
|
|
8852
8929
|
return {
|
|
8853
8930
|
id: graphic.id,
|
|
@@ -9502,6 +9579,7 @@ var TacticalDraw = class {
|
|
|
9502
9579
|
handlesLayer: this.handlesLayer,
|
|
9503
9580
|
graphicsStyle: this.graphicsStyle,
|
|
9504
9581
|
symbolColors: this.symbolColors,
|
|
9582
|
+
labelSizeBand: this.labelSizeBand,
|
|
9505
9583
|
signal: options?.signal,
|
|
9506
9584
|
closeOnClickAway: options?.closeOnClickAway,
|
|
9507
9585
|
modes: options?.modes,
|
|
@@ -9766,7 +9844,8 @@ var TacticalDraw = class {
|
|
|
9766
9844
|
if (!anchorPixel) continue;
|
|
9767
9845
|
const box = fitLabelBoxFromFeature(feature, anchorPixel, {
|
|
9768
9846
|
resolution: this.adapter.getResolution(),
|
|
9769
|
-
bearing: this.adapter.getBearing()
|
|
9847
|
+
bearing: this.adapter.getBearing(),
|
|
9848
|
+
labelSizeBand: this.labelSizeBand
|
|
9770
9849
|
});
|
|
9771
9850
|
if (box) labelCandidates.push({
|
|
9772
9851
|
feature,
|
|
@@ -10084,14 +10163,17 @@ function mergeSlot(base, override) {
|
|
|
10084
10163
|
else out[k] = v;
|
|
10085
10164
|
return out;
|
|
10086
10165
|
}
|
|
10087
|
-
function styleToStyleOptions(style) {
|
|
10166
|
+
function styleToStyleOptions(style, labelSizeBand) {
|
|
10088
10167
|
const out = {};
|
|
10089
10168
|
const strokeColor = style.strokeColor ?? style.color ?? DEFAULT_SYMBOL_COLOR;
|
|
10090
10169
|
if (strokeColor !== void 0) out.strokeColor = strokeColor;
|
|
10091
10170
|
if (style.strokeWidth !== void 0) out.strokeWidth = style.strokeWidth;
|
|
10092
10171
|
if (style.strokeDash !== void 0) out.strokeDash = [...style.strokeDash];
|
|
10093
10172
|
if (style.fillColor !== void 0) out.fillColor = style.fillColor;
|
|
10094
|
-
out.text = {
|
|
10173
|
+
out.text = {
|
|
10174
|
+
labelProperty: "text",
|
|
10175
|
+
...labelSizeBand
|
|
10176
|
+
};
|
|
10095
10177
|
return out;
|
|
10096
10178
|
}
|
|
10097
10179
|
function guideToStyleOptions(style) {
|
|
@@ -10365,4 +10447,4 @@ function nearestWorldCopyPosition(position, refLng) {
|
|
|
10365
10447
|
return [nearestWorldCopyLng(position[0], refLng), ...position.slice(1)];
|
|
10366
10448
|
}
|
|
10367
10449
|
//#endregion
|
|
10368
|
-
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"
|