@maptiler/sdk 4.2.0-rc.1 → 5.0.0-beta.m-r.1
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/README.md +276 -30
- package/dist/ImageViewer/ImageViewer.d.ts +6 -8
- package/dist/ImageViewer/ImageViewerMarker.d.ts +9 -9
- package/dist/ImageViewer/monkeyPatchML.d.ts +1 -1
- package/dist/Map.d.ts +155 -11
- package/dist/Marker/Marker.d.ts +397 -0
- package/dist/Marker/MarkerManager.d.ts +137 -0
- package/dist/Marker/altitude-math.d.ts +24 -0
- package/dist/Marker/collision-helpers.d.ts +160 -0
- package/dist/Marker/index.d.ts +2 -0
- package/dist/Marker/marker-adaptive-colors.d.ts +35 -0
- package/dist/Marker/marker-animation-presets.d.ts +60 -0
- package/dist/Marker/marker-constants.d.ts +111 -0
- package/dist/Marker/marker-content-registry.d.ts +17 -0
- package/dist/Marker/marker-dom-utils.d.ts +66 -0
- package/dist/Marker/marker-icons.d.ts +31 -0
- package/dist/Marker/marker-state-helpers.d.ts +2 -0
- package/dist/Marker/marker-svg-config.d.ts +84 -0
- package/dist/Marker/marker-symbols.d.ts +12 -0
- package/dist/Marker/marker-text-fit.d.ts +20 -0
- package/dist/Marker/marker-transitions.d.ts +29 -0
- package/dist/Marker/types.d.ts +458 -0
- package/dist/bundler/maplibre-gl-worker.mjs +13839 -0
- package/dist/bundler/next-worker.mjs +16 -0
- package/dist/bundler/next.cjs +42 -0
- package/dist/bundler/next.d.ts +6 -0
- package/dist/bundler/next.mjs +48 -0
- package/dist/bundler/side-effect.d.ts +2 -0
- package/dist/bundler/vite-worker.mjs +11 -0
- package/dist/bundler/webpack-worker.mjs +11 -0
- package/dist/config.d.ts +18 -0
- package/dist/constants/defaults.d.ts +0 -5
- package/dist/controls/MaptilerGeolocateControl.d.ts +1 -1
- package/dist/controls/MaptilerLogoControl.d.ts +1 -2
- package/dist/controls/MaptilerNavigationControl.d.ts +3 -4
- package/dist/controls/Minimap.d.ts +3 -3
- package/dist/eslint.mjs +4 -4
- package/dist/index.d.ts +9 -81
- package/dist/mapstyle.d.ts +11 -3
- package/dist/maptiler-sdk.css +108 -1
- package/dist/maptiler-sdk.d.ts +1 -1
- package/dist/maptiler-sdk.mjs +16763 -14351
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/routing.d.ts +1 -1
- package/dist/tools.d.ts +6 -7
- package/dist/utils/defaultWorkerUrl.d.ts +17 -0
- package/dist/utils/object.d.ts +1 -0
- package/package.json +26 -8
- package/dist/MLAdapters/AttributionControl.d.ts +0 -5
- package/dist/MLAdapters/BoxZoomHandler.d.ts +0 -7
- package/dist/MLAdapters/CanvasSource.d.ts +0 -5
- package/dist/MLAdapters/CooperativeGesturesHandler.d.ts +0 -5
- package/dist/MLAdapters/FullscreenControl.d.ts +0 -5
- package/dist/MLAdapters/GeoJSONSource.d.ts +0 -5
- package/dist/MLAdapters/GeolocateControl.d.ts +0 -5
- package/dist/MLAdapters/ImageSource.d.ts +0 -5
- package/dist/MLAdapters/KeyboardHandler.d.ts +0 -5
- package/dist/MLAdapters/LogoControl.d.ts +0 -5
- package/dist/MLAdapters/MapMouseEvent.d.ts +0 -5
- package/dist/MLAdapters/MapTouchEvent.d.ts +0 -5
- package/dist/MLAdapters/MapWheelEvent.d.ts +0 -5
- package/dist/MLAdapters/Marker.d.ts +0 -5
- package/dist/MLAdapters/NavigationControl.d.ts +0 -5
- package/dist/MLAdapters/Popup.d.ts +0 -5
- package/dist/MLAdapters/RasterDEMTileSource.d.ts +0 -5
- package/dist/MLAdapters/RasterTileSource.d.ts +0 -5
- package/dist/MLAdapters/ScaleControl.d.ts +0 -5
- package/dist/MLAdapters/ScrollZoomHandler.d.ts +0 -5
- package/dist/MLAdapters/Style.d.ts +0 -5
- package/dist/MLAdapters/TerrainControl.d.ts +0 -5
- package/dist/MLAdapters/TwoFingersTouchPitchHandler.d.ts +0 -5
- package/dist/MLAdapters/VectorTileSource.d.ts +0 -5
- package/dist/MLAdapters/VideoSource.d.ts +0 -5
- package/dist/ml-types.d.ts +0 -638
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Marker } from './Marker';
|
|
2
|
+
import { Map as SDKMap } from '../Map';
|
|
3
|
+
import { MarkerCollisionGroups, MarkerCollisionOptions } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* @class MarkerManagerImpl
|
|
6
|
+
* @description This singleton is used to batch marker updates and flush them to the DOM in a
|
|
7
|
+
* single animation frame to avoid multiple separate attribute writes
|
|
8
|
+
* It is not exposed as a public API and only used internally in the `Map` and `Marker` classes.
|
|
9
|
+
* It _may_ be used by multiple Maps.
|
|
10
|
+
*/
|
|
11
|
+
declare class MarkerManagerImpl {
|
|
12
|
+
private readonly dirty;
|
|
13
|
+
private animationFrameID;
|
|
14
|
+
private readonly markerMap;
|
|
15
|
+
private readonly mapIndex;
|
|
16
|
+
private readonly lastStyleId;
|
|
17
|
+
private readonly collisionState;
|
|
18
|
+
private readonly collisionPending;
|
|
19
|
+
private readonly dragEndHandlers;
|
|
20
|
+
private readonly altitudeState;
|
|
21
|
+
private altitudeLayerSequence;
|
|
22
|
+
private scheduleFlush;
|
|
23
|
+
private getOrCreateIndex;
|
|
24
|
+
private refreshAdaptiveColors;
|
|
25
|
+
register(marker: Marker, map: SDKMap): void;
|
|
26
|
+
deregister(marker: Marker, options?: {
|
|
27
|
+
deferDetach?: boolean;
|
|
28
|
+
}): void;
|
|
29
|
+
deregisterById(map: SDKMap, id: string): void;
|
|
30
|
+
deregisterAll(map: SDKMap, ids?: string[]): void;
|
|
31
|
+
getMap(marker: Marker): SDKMap | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the id of the map's current style (e.g. `"streets-v4-dark"`), or
|
|
34
|
+
* `undefined` when it cannot be determined (custom style spec / URL).
|
|
35
|
+
* Falls back to the raw stylesheet's `id` field, since the id is not part
|
|
36
|
+
* of the serialized `StyleSpecification` returned by `map.getStyle()`.
|
|
37
|
+
*/
|
|
38
|
+
getMapStyleId(map: SDKMap): string | undefined;
|
|
39
|
+
getMarkers(map: SDKMap): Marker[];
|
|
40
|
+
getMarker(map: SDKMap, id: string): Marker | undefined;
|
|
41
|
+
flushUpdates(): void;
|
|
42
|
+
addMarkerUpdateToQueue(marker: Marker): void;
|
|
43
|
+
cancelCuedUpdatesForMarker(marker: Marker): void;
|
|
44
|
+
/**
|
|
45
|
+
* Requests a full collision detection pass for a map's markers.
|
|
46
|
+
*
|
|
47
|
+
* The single entry point for everything that can change collisions —
|
|
48
|
+
* marker add / remove / move / drag, footprint changes, and camera
|
|
49
|
+
* `moveend`. Requests coalesce onto one animation frame, so a bulk add
|
|
50
|
+
* runs the pass once. During camera movement markers track their positions
|
|
51
|
+
* via MapLibre's own per-frame update; the pass itself only runs when
|
|
52
|
+
* movement settles (dense fields make it quadratic in overlapping pairs).
|
|
53
|
+
*/
|
|
54
|
+
invalidateCollisions(map: SDKMap): void;
|
|
55
|
+
/**
|
|
56
|
+
* Collision groups from the latest detection pass: the full sets of
|
|
57
|
+
* mutually-colliding markers, with no priority or winner/loser resolution.
|
|
58
|
+
* The behaviour layer consumes these to decide what to do about collisions.
|
|
59
|
+
*/
|
|
60
|
+
getCollisionGroups(map: SDKMap): MarkerCollisionGroups;
|
|
61
|
+
/**
|
|
62
|
+
* Configures collision detection for a map.
|
|
63
|
+
* @param options.proximityPadding - Distance in CSS px within which two
|
|
64
|
+
* markers count as "in proximity". Overlap always uses 0.
|
|
65
|
+
* @param options.accuracy - `high` (default) tests rotated markers with
|
|
66
|
+
* their actual rotated box; `low` uses the enclosing upright box, which
|
|
67
|
+
* is cheaper but over-reports collisions for rotated markers.
|
|
68
|
+
* @param options.behaviour - Default collision behaviour for every marker
|
|
69
|
+
* on the map; a marker's own `collisionBehaviour` option overrides it.
|
|
70
|
+
* Defaults to `always-show`.
|
|
71
|
+
* @param options.transitionDuration - Duration in ms of the hide/show/minimize fade. Defaults to `150`.
|
|
72
|
+
* @param options.transitionEasing - CSS easing function for the fade. Defaults to `"ease"`.
|
|
73
|
+
*/
|
|
74
|
+
setCollisionOptions(map: SDKMap, options: MarkerCollisionOptions): void;
|
|
75
|
+
/** Returns the fade-transition duration (ms) configured for `map`, or the SDK default if never configured. */
|
|
76
|
+
getCollisionTransitionDuration(map: SDKMap): number;
|
|
77
|
+
private applyCollisionTransitionVars;
|
|
78
|
+
private getOrCreateCollisionState;
|
|
79
|
+
/**
|
|
80
|
+
* The full detection pass. Builds each marker's screen box from its stored
|
|
81
|
+
* footprint and projected position (no DOM reads), finds intersecting
|
|
82
|
+
* pairs, derives collision groups, then diffs against the previous pass so
|
|
83
|
+
* markers only emit enter/exit transitions.
|
|
84
|
+
*
|
|
85
|
+
* Markers outside the (margin-padded) viewport never enter the pass: they
|
|
86
|
+
* are hidden outright — off screen there is nothing to show, and skipping
|
|
87
|
+
* them keeps the pair scan and placement proportional to what is actually
|
|
88
|
+
* visible. They rejoin (and fade back in) on the first pass that finds
|
|
89
|
+
* them near the viewport again. Consequence: collision events and
|
|
90
|
+
* `getCollisionGroups` only cover on-screen markers.
|
|
91
|
+
*/
|
|
92
|
+
private runCollisionPass;
|
|
93
|
+
/**
|
|
94
|
+
* The behaviour layer: turns the pass's geometry into display states via
|
|
95
|
+
* greedy priority placement — `hide-by-priority` losers hide (and stop
|
|
96
|
+
* blocking), `minimize-by-priority` losers minimize (and keep reserving
|
|
97
|
+
* their full-size box, so priority order is strict). See
|
|
98
|
+
* {@link resolveDisplayStates}.
|
|
99
|
+
*
|
|
100
|
+
* Hide/minimize act on *overlap* only — the proximity padding stays an
|
|
101
|
+
* events-only concern; `collisionRadius` is the per-marker way to act at a
|
|
102
|
+
* distance.
|
|
103
|
+
*/
|
|
104
|
+
private applyCollisionBehaviours;
|
|
105
|
+
/** Resolves a marker's collision behaviour against the map default. */
|
|
106
|
+
private effectiveBehaviour;
|
|
107
|
+
private getOrCreateCollisionSet;
|
|
108
|
+
private linkCollision;
|
|
109
|
+
/** Allocation-free set equality — dense passes must not allocate for unchanged collisions. */
|
|
110
|
+
private collisionSetsEqual;
|
|
111
|
+
private emitCollisionDiffs;
|
|
112
|
+
/**
|
|
113
|
+
* Starts driving `marker`'s per-frame altitude projection on `map`. Shared
|
|
114
|
+
* across every altitude-active marker on the map — several markers here
|
|
115
|
+
* still cost one no-op custom layer and one `render` listener, not one
|
|
116
|
+
* each. Called by {@link Marker.setAltitude} (and by {@link register} for
|
|
117
|
+
* a marker whose altitude was set before it had a map).
|
|
118
|
+
*/
|
|
119
|
+
registerAltitudeParticipant(marker: Marker, map: SDKMap): void;
|
|
120
|
+
/** Stops driving `marker`'s altitude projection. Tears down the shared layer/listener once the last participant on `map` leaves. */
|
|
121
|
+
deregisterAltitudeParticipant(marker: Marker, map: SDKMap): void;
|
|
122
|
+
/**
|
|
123
|
+
* The shared, always-behind-markers container every marker's ground-line
|
|
124
|
+
* element gets appended to on this map — a sibling of the marker elements
|
|
125
|
+
* (both live in `map.getCanvasContainer()`), not a descendant of any one
|
|
126
|
+
* marker, so a long line can never inherit a marker's camera-depth
|
|
127
|
+
* z-index and paint over some *other* marker's icon. Created together
|
|
128
|
+
* with the rest of the per-map altitude state.
|
|
129
|
+
*/
|
|
130
|
+
getGroundLineContainer(map: SDKMap): HTMLDivElement;
|
|
131
|
+
private getOrCreateAltitudeState;
|
|
132
|
+
private ensureAltitudeLayerInstalled;
|
|
133
|
+
private installAltitudeLayer;
|
|
134
|
+
private teardownAltitudeLayer;
|
|
135
|
+
}
|
|
136
|
+
export declare const MarkerManager: MarkerManagerImpl;
|
|
137
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CustomLayerProjectionData, LngLat, Map as MLMap } from 'maplibre-gl';
|
|
2
|
+
import { AltitudeReference } from './types';
|
|
3
|
+
/** A screen-space position in CSS pixels, DOM convention (+y down). */
|
|
4
|
+
export interface ScreenPoint {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
/** Clip-space W — proportional to camera distance. For ordering points against each other, not a real distance. */
|
|
8
|
+
depth: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Projects `lngLat`/`altitudeMeters` to a screen point using the projection data MapLibre hands to custom layers each frame.
|
|
12
|
+
* A JS port of MapLibre's `projectTileFor3D` shader function, so it works under mercator, globe, and mid-morph between the two.
|
|
13
|
+
*/
|
|
14
|
+
export declare function projectLngLatAltitude(lngLat: LngLat, altitudeMeters: number, projectionData: CustomLayerProjectionData, map: MLMap): ScreenPoint | null;
|
|
15
|
+
/**
|
|
16
|
+
* `groundBase` — MapLibre's own native marker position (terrain height, or 0 without terrain).
|
|
17
|
+
* `elevated` — the target: `nativeElevation + altitudeMeters` under `"ground"`, or plain `altitudeMeters` under `"sea"`.
|
|
18
|
+
* `belowGround` — `elevated` under `groundBase`, for fading markers DOM can't depth-test against terrain.
|
|
19
|
+
*/
|
|
20
|
+
export declare function computeAltitudeProjection(lngLat: LngLat, altitudeMeters: number, projectionData: CustomLayerProjectionData, map: MLMap, relativeTo: AltitudeReference): {
|
|
21
|
+
groundBase: ScreenPoint;
|
|
22
|
+
elevated: ScreenPoint;
|
|
23
|
+
belowGround: boolean;
|
|
24
|
+
} | null;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { MarkerOptions } from 'maplibre-gl';
|
|
2
|
+
import { MarkerCollisionDisplayState } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Pure geometry and grouping helpers for marker collision detection.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
/** Screen-space axis-aligned bounding box, in CSS pixels (+y down). */
|
|
8
|
+
export type Bounds = {
|
|
9
|
+
left: number;
|
|
10
|
+
right: number;
|
|
11
|
+
top: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
};
|
|
14
|
+
/** A point in screen space from top left in px. */
|
|
15
|
+
export type ScreenPoint = {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Screen-space oriented bounding box: the marker's actual rotated rectangle.
|
|
21
|
+
* `cos`/`sin` are precomputed from the rotation angle so both the SAT test
|
|
22
|
+
* and the enclosing-AABB derivation reuse them.
|
|
23
|
+
*/
|
|
24
|
+
export type OBB = {
|
|
25
|
+
/** Box center, screen px. */
|
|
26
|
+
cx: number;
|
|
27
|
+
cy: number;
|
|
28
|
+
/** Half extents along the box's own axes, px. */
|
|
29
|
+
hw: number;
|
|
30
|
+
hh: number;
|
|
31
|
+
/** Rotation of the box's axes (cos/sin of the angle). */
|
|
32
|
+
cos: number;
|
|
33
|
+
sin: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A marker's screen footprint, resolved from its props once per pass —
|
|
37
|
+
* never measured from the DOM inside the pass. (.getBoundingClientRect triggers layout)
|
|
38
|
+
*/
|
|
39
|
+
export type MarkerFootprint = {
|
|
40
|
+
/** Rendered width in CSS px, with 2-D scale applied. */
|
|
41
|
+
width: number;
|
|
42
|
+
/** Rendered height in CSS px, with 2-D scale applied. */
|
|
43
|
+
height: number;
|
|
44
|
+
/** Which point of the element sits on the marker's screen position. */
|
|
45
|
+
anchor: NonNullable<MarkerOptions["anchor"]>;
|
|
46
|
+
/** Screen-space pixel offset applied after projection (+y down). */
|
|
47
|
+
offset: [number, number];
|
|
48
|
+
/**
|
|
49
|
+
* Displacement from the element center to the rotation origin, in CSS px
|
|
50
|
+
* (+y down). Mirrors the inner wrapper's CSS `transform-origin`: `[0, 0]`
|
|
51
|
+
* for center-origin elements, `[0, height / 2]` for bottom-anchored shapes
|
|
52
|
+
* that rotate around their tip.
|
|
53
|
+
*/
|
|
54
|
+
pivot: [number, number];
|
|
55
|
+
/** The marker's own rotation in degrees (its inner-shell CSS rotation). */
|
|
56
|
+
rotation: number;
|
|
57
|
+
/** `true` when the marker rotates with the map bearing (`rotationAlignment: "map"`). */
|
|
58
|
+
mapAligned: boolean;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Computes the screen-space oriented box of a marker.
|
|
62
|
+
*
|
|
63
|
+
* The box is rotated by `angleDeg` (map bearing for map-aligned markers plus
|
|
64
|
+
* the marker's own rotation). For unrotated (viewport-aligned) markers the
|
|
65
|
+
* rotation terms collapse to the plain box. Pitch is deliberately ignored —
|
|
66
|
+
* under pitch the true footprint foreshortens, so the full-height box
|
|
67
|
+
* over-reserves space, which fails safe.
|
|
68
|
+
*
|
|
69
|
+
* @param position - The marker's *screen* position (normally
|
|
70
|
+
* `map.project(lngLat)`). Taken as an explicit argument so behaviours that
|
|
71
|
+
* render a marker somewhere other than its geographic position can pass
|
|
72
|
+
* the rendered point instead.
|
|
73
|
+
* @param footprint - The marker's resolved footprint.
|
|
74
|
+
* @param angleDeg - Total clockwise rotation of the box in degrees.
|
|
75
|
+
*/
|
|
76
|
+
export declare function computeMarkerOBB(position: ScreenPoint, footprint: MarkerFootprint, angleDeg: number): OBB;
|
|
77
|
+
/**
|
|
78
|
+
* Returns the axis-aligned box enclosing an oriented box, inflated by
|
|
79
|
+
* `padding` on every side. Used as the broad-phase box: it can only
|
|
80
|
+
* over-include, never miss a real intersection.
|
|
81
|
+
*/
|
|
82
|
+
export declare function obbToAABB(obb: OBB, padding?: number): Bounds;
|
|
83
|
+
/**
|
|
84
|
+
* Exact intersection test for two oriented boxes via the separating axis
|
|
85
|
+
* theorem: two convex boxes are disjoint if some axis of either box
|
|
86
|
+
* separates their projections, so only the four box axes need testing.
|
|
87
|
+
*
|
|
88
|
+
* SAT is the computational form of Minkowski-difference collision detection
|
|
89
|
+
* for convex polytopes — see
|
|
90
|
+
* https://en.wikipedia.org/wiki/Minkowski_addition#Collision_detection
|
|
91
|
+
*
|
|
92
|
+
* @param padding - Inflates both boxes' half extents; the two-box test then
|
|
93
|
+
* answers "are the exact boxes within `2 * padding` of each other" the same
|
|
94
|
+
* way the pre-inflated AABBs do for the axis-aligned path.
|
|
95
|
+
*/
|
|
96
|
+
export declare function obbIntersect(a: OBB, b: OBB, padding?: number): boolean;
|
|
97
|
+
/** Returns `bounds` grown by `padding` px on every side. */
|
|
98
|
+
export declare function inflateBounds(bounds: Bounds, padding: number): Bounds;
|
|
99
|
+
/** The single intersection test — overlap and proximity both go through here. */
|
|
100
|
+
export declare function boundsIntersect(a: Bounds, b: Bounds): boolean;
|
|
101
|
+
/** Answers "which entries are near this box" for the detection pass. */
|
|
102
|
+
export type CollisionCandidateSource<T> = {
|
|
103
|
+
query(bounds: Bounds): readonly T[];
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* The seam between the pairwise scan and the grouping/event logic.
|
|
107
|
+
*
|
|
108
|
+
* Currently a linear scan (O(n) per query, O(n²) per pass). When marker
|
|
109
|
+
* counts demand it, replace the internals with a spatial index (rbush /
|
|
110
|
+
* uniform grid) — callers only depend on `query`.
|
|
111
|
+
*/
|
|
112
|
+
export declare function createCandidateSource<T>(items: readonly T[], boundsOf: (item: T) => Bounds): CollisionCandidateSource<T>;
|
|
113
|
+
/**
|
|
114
|
+
* How a marker participates in the greedy priority resolution.
|
|
115
|
+
* - `always` — always shown, but still reserves its space (blocks losers).
|
|
116
|
+
* - `hide` — hidden when it collides with an already-placed marker; frees
|
|
117
|
+
* its space.
|
|
118
|
+
* - `minimize` — minimized when it collides with an already-placed marker;
|
|
119
|
+
* still reserves its *full-size* box (renders small, blocks full), so
|
|
120
|
+
* priority order is strict: a lower-priority marker can never show
|
|
121
|
+
* full-size in space a minimized higher-priority marker occupies.
|
|
122
|
+
*/
|
|
123
|
+
export type ResolutionMode = "always" | "hide" | "minimize";
|
|
124
|
+
/** One marker's input to {@link resolveDisplayStates}. */
|
|
125
|
+
export type ResolutionEntry = {
|
|
126
|
+
mode: ResolutionMode;
|
|
127
|
+
/** Numeric priority; higher wins. */
|
|
128
|
+
priority: number;
|
|
129
|
+
/** Full-size box at the marker's rendered position. */
|
|
130
|
+
obb: OBB;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Greedy priority placement — the winner/loser resolution behind the
|
|
134
|
+
* hide/minimize collision behaviours.
|
|
135
|
+
*
|
|
136
|
+
* Entries are placed in priority order (ties: input order, i.e. registration
|
|
137
|
+
* order). Each entry is tested only against already-placed boxes; hidden
|
|
138
|
+
* markers free their space for lower-priority ones, while `always` and
|
|
139
|
+
* minimized markers keep reserving their full box. Rerunning on the same
|
|
140
|
+
* input always yields the same output — placement never feeds back into the
|
|
141
|
+
* boxes it is tested against, so results cannot oscillate between passes.
|
|
142
|
+
*
|
|
143
|
+
* @param entries - One entry per marker still in contention, in registration order.
|
|
144
|
+
* @param exact - `true` tests the rotated boxes (SAT), `false` their enclosing
|
|
145
|
+
* upright boxes — mirrors the detection pass's `accuracy` setting.
|
|
146
|
+
* @returns Display state per entry, indexed like `entries`.
|
|
147
|
+
*/
|
|
148
|
+
export declare function resolveDisplayStates(entries: readonly ResolutionEntry[], exact?: boolean): MarkerCollisionDisplayState[];
|
|
149
|
+
/**
|
|
150
|
+
* Derives collision groups (connected components) from pairwise collisions.
|
|
151
|
+
*
|
|
152
|
+
* Groups keep the *full set* of mutually-colliding items — no winners or
|
|
153
|
+
* losers — so consumers can inspect full collision sets rather than only
|
|
154
|
+
* the greedy placement outcome.
|
|
155
|
+
*
|
|
156
|
+
* @param items - All entries in the pass, indexable by the pair indices.
|
|
157
|
+
* @param pairs - Colliding index pairs `[i, j]`.
|
|
158
|
+
* @returns Components with two or more members; singletons are not groups.
|
|
159
|
+
*/
|
|
160
|
+
export declare function deriveCollisionGroups<T>(items: readonly T[], pairs: readonly [number, number][]): T[][];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defaultReferenceStyleMap } from '@maptiler/client';
|
|
2
|
+
/**
|
|
3
|
+
* Unversioned reference-style key, matching the reference styles of
|
|
4
|
+
* `MapStyle` from `@maptiler/client` (e.g. `MapStyle.STREETS` → `"streets"`).
|
|
5
|
+
*/
|
|
6
|
+
export type ReferenceStyleKey = Lowercase<keyof typeof defaultReferenceStyleMap>;
|
|
7
|
+
/**
|
|
8
|
+
* Style key the marker colours can target: an unversioned reference-style id,
|
|
9
|
+
* optionally with a variant suffix (e.g. `"streets"`, `"streets-dark"`).
|
|
10
|
+
* Versioned style ids (`"streets-v4-dark"`) are normalised to this form by
|
|
11
|
+
* {@link getAdaptiveColors}.
|
|
12
|
+
*/
|
|
13
|
+
export type AdaptiveStyleKey = ReferenceStyleKey | `${ReferenceStyleKey}-${string}`;
|
|
14
|
+
/** The colours of each marker part for one map style. */
|
|
15
|
+
export type AdaptiveColorSet = {
|
|
16
|
+
/** Fill of the inner area. */
|
|
17
|
+
innerColor: string;
|
|
18
|
+
/** Fill of the outer body / border. */
|
|
19
|
+
outerColor: string;
|
|
20
|
+
/** Colour of the content (text, glyph). */
|
|
21
|
+
contentColor: string;
|
|
22
|
+
/** Stroke of the outline (only visible when an outline width is set). */
|
|
23
|
+
outlineColor: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Resolves the default marker colours for a given map style and shape.
|
|
27
|
+
*
|
|
28
|
+
* Lookup order: exact style key (version stripped, variant kept) → reference
|
|
29
|
+
* style without variant → `base`, so an unknown style id resolves to `base`.
|
|
30
|
+
* Shapes in {@link INVERTED_COLOR_SHAPES} get the style's colours swapped: the
|
|
31
|
+
* accent colour on the body and the mark, the body colour on the inner fill.
|
|
32
|
+
* @param styleId - Style id, versioned (`"streets-v4-dark"`) or not (`"streets-dark"`).
|
|
33
|
+
* @param shape - Marker shape key; omit for the colours of an ordinary shape.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getAdaptiveColors(styleId: string, shape?: string): AdaptiveColorSet;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { EasingFunctionName } from '../MaptilerAnimation/types';
|
|
2
|
+
import { EnterAnimationPreset, ExitAnimationPreset, IdleAnimationPreset, Vector2 } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* An `enter`/`exit` preset's animated state at one end of its motion:
|
|
5
|
+
* opacity, 2-D scale, and a vertical `lift` offset in CSS px (used by
|
|
6
|
+
* `enter`'s `drop`/`bounce`; `0` elsewhere).
|
|
7
|
+
*/
|
|
8
|
+
export type LifecycleAnimationValue = {
|
|
9
|
+
opacity: number;
|
|
10
|
+
scale: Vector2;
|
|
11
|
+
lift: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The "hidden" end of `preset`'s `enter` animation — the value a marker
|
|
15
|
+
* eases from. `baseOpacity`/`baseScale` are the marker's own configured
|
|
16
|
+
* values, i.e. the "shown" end shared by every preset.
|
|
17
|
+
*/
|
|
18
|
+
export declare function enterPresetHiddenValue(preset: EnterAnimationPreset, baseOpacity: number, baseScale: Vector2): LifecycleAnimationValue;
|
|
19
|
+
/**
|
|
20
|
+
* The "hidden" end of `preset`'s `exit` animation — the value a marker
|
|
21
|
+
* eases to. `baseOpacity`/`baseScale` are the marker's own configured
|
|
22
|
+
* values, i.e. the "shown" end shared by every preset.
|
|
23
|
+
*/
|
|
24
|
+
export declare function exitPresetHiddenValue(preset: ExitAnimationPreset, baseOpacity: number, baseScale: Vector2): LifecycleAnimationValue;
|
|
25
|
+
/**
|
|
26
|
+
* Scales a preset's `hidden` value by `magnitude` — `1` (the default) is the
|
|
27
|
+
* full designed motion (`hidden` as-is), `0` is no motion at all (`shown`),
|
|
28
|
+
* values beyond `1` extrapolate past `hidden`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function scaleLifecycleMagnitude(shown: LifecycleAnimationValue, hidden: LifecycleAnimationValue, magnitude: number): LifecycleAnimationValue;
|
|
31
|
+
/**
|
|
32
|
+
* Which marker channel an idle preset animates. `value` at a keyframe
|
|
33
|
+
* multiplies the marker's base value for `scale`/`opacity` (rest = `1`), or
|
|
34
|
+
* is added to it for `rotation`/`lift` (rest = `0`).
|
|
35
|
+
*/
|
|
36
|
+
export type IdleAnimationChannel = "scale" | "opacity" | "rotation" | "lift";
|
|
37
|
+
/**
|
|
38
|
+
* Scales an idle keyframe's `value` by `magnitude` around its channel's rest
|
|
39
|
+
* value (`1` for `scale`/`opacity`, `0` for `rotation`/`lift`) — `1` (the
|
|
40
|
+
* default) is the full designed motion, `0` is no motion at all (rest).
|
|
41
|
+
*/
|
|
42
|
+
export declare function scaleIdleMagnitude(channel: IdleAnimationChannel, value: number, magnitude: number): number;
|
|
43
|
+
/** One control point in an idle preset's per-iteration curve. */
|
|
44
|
+
export type IdleAnimationKeyframe = {
|
|
45
|
+
/** Position within one loop iteration, `0`–`1`. */
|
|
46
|
+
delta: number;
|
|
47
|
+
/** Channel value at this point — see {@link IdleAnimationChannel}. */
|
|
48
|
+
value: number;
|
|
49
|
+
/** Easing from the previous keyframe to this one. Defaults to `"Linear"`. */
|
|
50
|
+
easing?: EasingFunctionName;
|
|
51
|
+
};
|
|
52
|
+
export type IdlePresetConfig = {
|
|
53
|
+
channel: IdleAnimationChannel;
|
|
54
|
+
/**
|
|
55
|
+
* Always starts and ends at rest (`delta` `0` and `1`); every preset's
|
|
56
|
+
* animated motion is centered on `delta` `0.5`.
|
|
57
|
+
*/
|
|
58
|
+
keyframes: IdleAnimationKeyframe[];
|
|
59
|
+
};
|
|
60
|
+
export declare const IDLE_PRESET_CONFIG: Record<IdleAnimationPreset, IdlePresetConfig>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { MarkerOptions } from 'maplibre-gl';
|
|
2
|
+
import { EasingFunctionName } from '../MaptilerAnimation/types';
|
|
3
|
+
import { EnterAnimationPreset, ExitAnimationPreset, IdleAnimationPreset, MapTilerMarkerUIStateName, MapTilerMarkerShape, MapTilerMarkerSize, MapTilerMarkerShadow } from './types';
|
|
4
|
+
import { AdaptiveColorSet, AdaptiveStyleKey } from './marker-adaptive-colors';
|
|
5
|
+
import { ContentMetrics, ShapeSize } from './marker-svg-config';
|
|
6
|
+
export declare const DEFAULT_SHAPE: MapTilerMarkerShape;
|
|
7
|
+
export declare const DEFAULT_SIZE: MapTilerMarkerSize;
|
|
8
|
+
/** Shadow used when `shadow` isn't set — per size, as in the design (L strong, M medium, S and the xs dot soft). */
|
|
9
|
+
export declare const DEFAULT_SHADOW_BY_SIZE: Record<MapTilerMarkerSize, MapTilerMarkerShadow>;
|
|
10
|
+
export declare const DEFAULT_OUTLINE_WIDTH = 2;
|
|
11
|
+
/** Anchor used when `MarkerOptions.anchor` is unset (matches MapLibre's own default). */
|
|
12
|
+
export declare const DEFAULT_ANCHOR: NonNullable<MarkerOptions["anchor"]>;
|
|
13
|
+
/** Size a minimized marker renders at when `minimizedOptions.size` is unset. */
|
|
14
|
+
export declare const DEFAULT_MINIMIZED_SIZE: MapTilerMarkerSize;
|
|
15
|
+
/** Duration (ms) of transitions and animations when their `duration` is omitted. */
|
|
16
|
+
export declare const DEFAULT_ANIMATION_DURATION_MS = 1000;
|
|
17
|
+
/**
|
|
18
|
+
* Default proximity threshold in CSS px: two markers whose boxes come within
|
|
19
|
+
* this distance of each other are "in proximity". Overlap always uses 0.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DEFAULT_PROXIMITY_PADDING = 4;
|
|
22
|
+
/** Matches the fade duration in the SDK stylesheet (`.maptiler-marker-collision-fade`). */
|
|
23
|
+
export declare const COLLISION_FADE_DURATION_MS = 150;
|
|
24
|
+
export declare const SIZE_PX: Record<MapTilerMarkerSize, number>;
|
|
25
|
+
export declare const SHADOW_FILTER: Record<MapTilerMarkerShadow, string>;
|
|
26
|
+
/** Content sizing per marker size, shared by every shape (px). */
|
|
27
|
+
export declare const CONTENT_METRICS: Record<ShapeSize, ContentMetrics>;
|
|
28
|
+
/**
|
|
29
|
+
* Default marker colours per map style. `base` doubles as the fallback for
|
|
30
|
+
* styles without a dedicated entry.
|
|
31
|
+
*/
|
|
32
|
+
export declare const ADAPTIVE_COLORS: {
|
|
33
|
+
base: AdaptiveColorSet;
|
|
34
|
+
} & Partial<Record<AdaptiveStyleKey, AdaptiveColorSet>>;
|
|
35
|
+
/**
|
|
36
|
+
* Shapes whose default colours are the map style's, swapped: a blue body with a white inner fill and
|
|
37
|
+
* a blue mark. Colours set explicitly aren't touched.
|
|
38
|
+
*/
|
|
39
|
+
export declare const INVERTED_COLOR_SHAPES: readonly string[];
|
|
40
|
+
export declare const ADAPTIVE_COLOR_KEYS: readonly ["outerColor", "innerColor", "contentColor", "outlineColor"];
|
|
41
|
+
export declare const MAPLIBRE_MARKER_CONSTRUCTOR_OVERRIDES: MarkerOptions;
|
|
42
|
+
export declare const CUSTOM_ELEMENT_MINIMIZED_KEYS: readonly ["innerColor", "outerColor", "contentColor", "shadow", "opacity"];
|
|
43
|
+
export declare const MAPTILER_BASE_OPTIONS_KEYS: readonly ["lngLat", "shape", "size", "innerColor", "outerColor", "contentColor", "outline", "outlineColor", "shadow", "opacity", "opacityWhenCovered", "name", "title", "content", "htmlAttributes", "scale", "visible", "priority", "userData", "collisionBehaviour", "collisionRadius", "minimizedOptions", "rotation", "debug", "states", "transitions"];
|
|
44
|
+
/** Pending props that change a marker's footprint and therefore its collisions. */
|
|
45
|
+
export declare const FOOTPRINT_PROPS: readonly ["shape", "size", "scale", "rotation"];
|
|
46
|
+
export declare const UI_STATE_PRIORITY: readonly MapTilerMarkerUIStateName[];
|
|
47
|
+
/** Vertical offset (CSS px) `enter`'s `drop`/`bounce` start from on `enter`. */
|
|
48
|
+
export declare const LIFECYCLE_LIFT_PX = 48;
|
|
49
|
+
/** Default easing per `enter` preset, used when `MarkerAnimationOptions.easing` doesn't override it. */
|
|
50
|
+
export declare const ENTER_PRESET_EASING: Record<EnterAnimationPreset, EasingFunctionName>;
|
|
51
|
+
/** Default easing per `exit` preset, used when `MarkerAnimationOptions.easing` doesn't override it. */
|
|
52
|
+
export declare const EXIT_PRESET_EASING: Record<ExitAnimationPreset, EasingFunctionName>;
|
|
53
|
+
/** Scale multiplier `explode` grows the marker to (from its own base scale) while it fades out. */
|
|
54
|
+
export declare const EXPLODE_SCALE_MULTIPLIER = 2;
|
|
55
|
+
export declare const PULSE_SCALE_PEAK = 1.15;
|
|
56
|
+
export declare const PULSE_OPACITY_PEAK = 0.45;
|
|
57
|
+
export declare const RING_PEAK_DEG = 12;
|
|
58
|
+
export declare const IDLE_BOUNCE_LIFT_PX = 14;
|
|
59
|
+
/**
|
|
60
|
+
* Default loop duration (ms) per idle preset, used when
|
|
61
|
+
* `MarkerIdleAnimationOptions.duration` is omitted — overrides the generic
|
|
62
|
+
* `1000` documented on {@link MarkerAnimationOptions}. `pulsescale`/
|
|
63
|
+
* `pulseopacity` default to ~1Hz; `ring`/`bounce` recur every few seconds.
|
|
64
|
+
*/
|
|
65
|
+
export declare const IDLE_PRESET_DEFAULT_DURATION: Record<IdleAnimationPreset, number>;
|
|
66
|
+
/** Design-space size (units) for SVG template glyphs. */
|
|
67
|
+
export declare const GLYPH_VIEWBOX_SIZE = 24;
|
|
68
|
+
/** Letter spacing of text content, in em. */
|
|
69
|
+
export declare const TEXT_LETTER_SPACING_EM = -0.06;
|
|
70
|
+
/** Font weight of text content — between Medium (500) and SemiBold (600); the marker font is variable (400–600). */
|
|
71
|
+
export declare const TEXT_FONT_WEIGHT = 575;
|
|
72
|
+
/** Font stack of marker text — keep in step with `.maptiler-sdk-marker-font` in `style_template.css`. */
|
|
73
|
+
export declare const MARKER_FONT_FAMILY = "\"Inter\", \"MapTiler Inter\", system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif";
|
|
74
|
+
/** Cap height of the marker font, in em (Inter) — the height of the letters a label has to fit. */
|
|
75
|
+
export declare const TEXT_CAP_HEIGHT_EM = 0.727;
|
|
76
|
+
/** Space kept free between a label and the edge of the inner fill, in px, so antialiased glyph edges aren't clipped. */
|
|
77
|
+
export declare const TEXT_FIT_MARGIN_PX = 1;
|
|
78
|
+
/** Smallest font size a label is shrunk to when it doesn't fit (px); below this it's clipped rather than made illegible. */
|
|
79
|
+
export declare const TEXT_MIN_FONT_PX = 6;
|
|
80
|
+
/** Width of the outer-colour ring around the xs dot's inner fill (px). */
|
|
81
|
+
export declare const DOT_RING_PX = 2;
|
|
82
|
+
/**
|
|
83
|
+
* Minimum margin in CSS px around the viewport within which markers still
|
|
84
|
+
* participate in the pass. Off-viewport markers are excluded and hidden, but
|
|
85
|
+
* a marker just past the edge must keep blocking its on-screen neighbours,
|
|
86
|
+
* or edge behaviour would churn while panning.
|
|
87
|
+
*/
|
|
88
|
+
export declare const VIEWPORT_CULL_MARGIN_PX = 200;
|
|
89
|
+
/**
|
|
90
|
+
* Base z-index for camera-depth ordering among altitude-active markers (see
|
|
91
|
+
* the altitude render loop's `onRender`). Well above the small integers
|
|
92
|
+
* `priority` typically produces, so depth-ordered altitude markers land
|
|
93
|
+
* above statically-ordered ones rather than interleaving with them —
|
|
94
|
+
* "closer to the camera" is a different axis from "higher priority", and
|
|
95
|
+
* mixing the two into one ranking isn't attempted here.
|
|
96
|
+
*/
|
|
97
|
+
export declare const ALTITUDE_Z_INDEX_BASE = 1000;
|
|
98
|
+
export declare const SVG_NS = "http://www.w3.org/2000/svg";
|
|
99
|
+
export declare const DEBUG_COLOR = "#ff00ff";
|
|
100
|
+
export declare const CUSTOM_ELEMENT_CLASSNAME = "marker-transform-wrapper";
|
|
101
|
+
/** Added to every marker's wrapper element so marker text can pick up the SDK font. */
|
|
102
|
+
export declare const MARKER_FONT_CLASSNAME = "maptiler-sdk-marker-font";
|
|
103
|
+
export declare const SHAPE_SVG_CLASSNAME = "marker-shape";
|
|
104
|
+
export declare const DEFAULT_CONTENT_CLASSNAME = "marker-default-content";
|
|
105
|
+
export declare const MINIMIZED_DOT_CLASSNAME = "marker-minimized-dot";
|
|
106
|
+
export declare const COLLISION_FADE_CLASSNAME = "maptiler-marker-collision-fade";
|
|
107
|
+
export declare const COLLISION_HIDDEN_CLASSNAME = "maptiler-marker-collision-hidden";
|
|
108
|
+
export declare const COLLISION_CULLED_CLASSNAME = "maptiler-marker-collision-culled";
|
|
109
|
+
export declare const ALTITUDE_HIDDEN_CLASSNAME = "maptiler-marker-altitude-hidden";
|
|
110
|
+
export declare const ALTITUDE_OCCLUDED_CLASSNAME = "maptiler-marker-altitude-occluded";
|
|
111
|
+
export declare const GROUND_LINE_CLASSNAME = "maptiler-marker-groundline";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Produces marker content from template parameters.
|
|
3
|
+
* May return a string (rendered as marker text), an `HTMLElement` (rendered
|
|
4
|
+
* in a foreignObject sized to the content circle), or an `SVGElement`
|
|
5
|
+
* (treated like a content-type glyph, designed in a
|
|
6
|
+
* `GLYPH_VIEWBOX_SIZE`-unit square).
|
|
7
|
+
*/
|
|
8
|
+
export type MarkerTemplateFactory = (params?: Record<string, number | string>) => string | HTMLElement | SVGElement;
|
|
9
|
+
/**
|
|
10
|
+
* Registers (or overrides) a template factory usable via the marker
|
|
11
|
+
* `template` / `templateParams` options.
|
|
12
|
+
* @param name - Identifier passed as `template`.
|
|
13
|
+
* @param factory - Template factory, see {@link MarkerTemplateFactory}.
|
|
14
|
+
*/
|
|
15
|
+
export declare function registerMarkerTemplate(name: string, factory: MarkerTemplateFactory): void;
|
|
16
|
+
/** Returns the factory for a template, or `undefined` when unknown. */
|
|
17
|
+
export declare function getMarkerTemplate(name: string): MarkerTemplateFactory | undefined;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { MarkerOptions } from 'maplibre-gl';
|
|
2
|
+
import { MapTilerMarkerOptions, PendingMarkerUpdates } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the inner transform wrapper from a marker's outer root element
|
|
5
|
+
* (or returns `element` itself when it already is the wrapper, or has none).
|
|
6
|
+
* @param element - The marker's outer root element.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveMarkerWrapper(element: HTMLElement): HTMLElement;
|
|
9
|
+
/**
|
|
10
|
+
* Seeds the CSS custom properties that drive marker colors and shadow.
|
|
11
|
+
* Used on the generated wrapper, and on user-supplied custom elements so
|
|
12
|
+
* their styles can consume the same variables.
|
|
13
|
+
* @param element - Element to receive the custom properties.
|
|
14
|
+
* @param options - Resolved marker options.
|
|
15
|
+
*/
|
|
16
|
+
export declare function applyMarkerStyleVariables(element: HTMLElement | SVGElement, options: MapTilerMarkerOptions): void;
|
|
17
|
+
/**
|
|
18
|
+
* Creates the root wrapper `div` for a marker, seeding all CSS custom
|
|
19
|
+
* properties and the initial `data-*` attributes used by {@link applyTransform}.
|
|
20
|
+
* @param options - Resolved marker options.
|
|
21
|
+
* @returns The outer root element, ready to be handed to MapLibre.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createMarkerElement(options: MapTilerMarkerOptions): HTMLDivElement;
|
|
24
|
+
/**
|
|
25
|
+
* Commits a batch of pending property updates onto a live marker element.
|
|
26
|
+
* Called by `Marker[FlushDOMUpdatesSymbol]()` when there are pending updates.
|
|
27
|
+
* A key being present in `props` (even with an `undefined` value) means
|
|
28
|
+
* "apply this property".
|
|
29
|
+
* @param element - The marker's outer root element.
|
|
30
|
+
* @param props - Pending property updates.
|
|
31
|
+
* @param styleId - Current map style id, used to resolve unset colours to their map-style defaults.
|
|
32
|
+
*/
|
|
33
|
+
export declare function updateMarkerElement(element: HTMLElement, props: PendingMarkerUpdates, styleId?: string): void;
|
|
34
|
+
/** Toggles the collision-hidden fade (rules live in the SDK stylesheet). */
|
|
35
|
+
export declare function applyCollisionHidden(element: HTMLElement, hidden: boolean): void;
|
|
36
|
+
/** Removes the fade class — only call once no fade/dip is in flight, or it cuts the animation short. */
|
|
37
|
+
export declare function releaseCollisionFadeClass(element: HTMLElement): void;
|
|
38
|
+
/**
|
|
39
|
+
* `display: none`s a collision-hidden marker once its fade completes. Un-culling doesn't flush
|
|
40
|
+
* layout itself — {@link MarkerManagerImpl} batches that once per pass.
|
|
41
|
+
* @returns `true` when the call actually changed the culled state.
|
|
42
|
+
*/
|
|
43
|
+
export declare function applyCollisionCulled(element: HTMLElement, culled: boolean): boolean;
|
|
44
|
+
/** Hides a marker with no valid altitude-projected position this frame (off-screen/behind camera). Not the below-ground case — see {@link applyAltitudeOccluded}. */
|
|
45
|
+
export declare function applyAltitudeHidden(element: HTMLElement, hidden: boolean): void;
|
|
46
|
+
/** Fades a below-ground marker (DOM markers aren't depth-tested against terrain) — position and pointer events stay real, only opacity changes. */
|
|
47
|
+
export declare function applyAltitudeOccluded(element: HTMLElement, occluded: boolean): void;
|
|
48
|
+
/** Minimized rendering for custom `element` markers: hides its content via `visibility` (keeps the layout box for positioning) and overlays a dot on the anchor point. SVG-root elements get hidden without a dot. */
|
|
49
|
+
export declare function applyMinimizedDot(element: HTMLElement | SVGElement, anchor: NonNullable<MarkerOptions["anchor"]>, enabled: boolean): void;
|
|
50
|
+
/** Sets the lifecycle-animation vertical offset in CSS px. Animation-only, bypasses {@link updateMarkerElement}'s batching. */
|
|
51
|
+
export declare function applyLifecycleLift(element: HTMLElement, liftPx: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* Wraps `element` in a new container `div`.
|
|
54
|
+
* MapLibre requires a single root element per marker; this outer wrapper
|
|
55
|
+
* lets MapLibre apply its own transforms without interfering with the
|
|
56
|
+
* inner wrapper's scale/rotation transform.
|
|
57
|
+
* @param element - Element to wrap.
|
|
58
|
+
*/
|
|
59
|
+
export declare function wrap(element: HTMLElement): HTMLDivElement;
|
|
60
|
+
/**
|
|
61
|
+
* Prevents MapLibre element events from firing when the outer root element
|
|
62
|
+
* is clicked but the inner wrapper is not — e.g. whitespace within the
|
|
63
|
+
* MapLibre-positioned container.
|
|
64
|
+
* @param parent - The marker's outer root element.
|
|
65
|
+
*/
|
|
66
|
+
export declare function forwardPointerEvents(parent: HTMLElement): void;
|