@tomtom-org/maps-sdk 0.57.0 → 0.58.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.
@@ -1,5 +1,5 @@
1
1
  import { AllLayoutProperties, AllPaintProperties, BackgroundLayerSpecification, CircleLayerSpecification, DataDrivenPropertyValueSpecification, ExpressionFilterSpecification, ExpressionSpecification, FilterSpecification, GeoJSONSource, GeoJSONSourceSpecification, LayerSpecification, LineLayerSpecification, LngLat, Map, MapGeoJSONFeature, MapOptions, Source, SourceSpecification, StyleImageInterface, StyleImageMetadata, StyleSpecification, SymbolLayerSpecification } from "maplibre-gl";
2
- import { Anything, AreaAnalyticsMetricKey, AreaAnalyticsMetrics, BBox, ChargingSpeed, ChargingStop, ChargingStopProps, CommonPlaceProps, CountrySectionProps, DelayMagnitude, DisplayUnits, GetPositionEntryPointOption, GlobalConfig, Instruction, Language, POICategory, Place, Places, PolygonFeature, PolygonFeatures, Route, RouteProps, Routes, SectionProps, SectionType, TrafficAreaAnalytics, TrafficIncident, TrafficIncidentBaseProperties, TrafficIncidentCategory, TrafficIncidentDetails, TrafficIncidentTimeValidity, TrafficSectionProps, Waypoint, WaypointLike, Waypoints } from "@tomtom-org/maps-sdk/core";
2
+ import { Anything, AreaAnalyticsMetricKey, AreaAnalyticsMetrics, BBox, ChargingSpeed, ChargingStop, ChargingStopProps, CommonPlaceProps, CountrySectionProps, DelayMagnitude, DisplayUnits, EntryPoint, GetPositionEntryPointOption, GlobalConfig, Instruction, Language, POICategory, Place, Places, PolygonFeature, PolygonFeatures, Route, RouteProps, Routes, SectionProps, SectionType, TrafficAreaAnalytics, TrafficIncident, TrafficIncidentBaseProperties, TrafficIncidentCategory, TrafficIncidentDetails, TrafficIncidentTimeValidity, TrafficSectionProps, Waypoint, WaypointLike, Waypoints } from "@tomtom-org/maps-sdk/core";
3
3
  //#region src/shared/types/style.d.ts
4
4
  /**
5
5
  * Indicator of a light or dark theme.
@@ -27,7 +27,8 @@ type LightDark = 'light' | 'dark';
27
27
  * precisionMode: 'box',
28
28
  * paddingBoxPx: 5,
29
29
  * cursorOnHover: 'pointer',
30
- * longHoverDelayOnStillMapMS: 300
30
+ * longHoverDelayOnStillMapMS: 300,
31
+ * hoverGracePeriodMS: 400
31
32
  * };
32
33
  *
33
34
  * // Mobile-optimized with larger hit area
@@ -46,7 +47,7 @@ type LightDark = 'light' | 'dark';
46
47
  *
47
48
  * @group User Interaction Events
48
49
  */
49
- type MapEventsConfig = EventHandlerCursorConfig & {
50
+ type MapEventsConfig = EventHandlerConfig & {
50
51
  /**
51
52
  * Optional configuration to show custom cursor when clicking (mouse down).
52
53
  *
@@ -547,20 +548,12 @@ export type TomTomMapParams = Partial<GlobalConfig> & {
547
548
  */
548
549
  style?: StyleInput;
549
550
  /**
550
- * Event handler configuration for map interactions.
551
- *
552
- * Define callbacks for various map events like clicks, hovers, and movements.
551
+ * How user events are detected and timed, and which cursors they show, for every module.
552
+ * Change it later with {@link TomTomMap.updateEventsConfig}.
553
553
  *
554
554
  * @example
555
555
  * ```typescript
556
- * events: {
557
- * onClick: (event) => {
558
- * console.log('Clicked at', event.lngLat);
559
- * },
560
- * onMoveEnd: () => {
561
- * console.log('Map moved to', map.getCenter());
562
- * }
563
- * }
556
+ * events: { paddingBoxPx: 10, longHoverDelayOnStillMapMS: 500, hoverGracePeriodMS: 1000 }
564
557
  * ```
565
558
  */
566
559
  events?: MapEventsConfig;
@@ -1161,6 +1154,22 @@ export declare class TomTomMap {
1161
1154
  * @see {@link https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes | ISO 639-1 Language Codes}
1162
1155
  */
1163
1156
  setLanguage(language: Language): void;
1157
+ /**
1158
+ * Changes the map's user events configuration at runtime.
1159
+ *
1160
+ * @param config Merged into the current configuration, set at construction through
1161
+ * {@link TomTomMapParams.events}: what it leaves out, or sets `undefined`, keeps its value.
1162
+ *
1163
+ * @remarks
1164
+ * A module's own `events` config still overrides the cursor and `hoverGracePeriodMS` for its
1165
+ * features. A long hover or a grace period already running keeps the delay it started with.
1166
+ *
1167
+ * @example
1168
+ * ```typescript
1169
+ * map.updateEventsConfig({ longHoverDelayOnStillMapMS: 600, hoverGracePeriodMS: 1000 });
1170
+ * ```
1171
+ */
1172
+ updateEventsConfig(config: MapEventsConfig): void;
1164
1173
  /**
1165
1174
  * Retrieves the current visible map area as a GeoJSON bounding box.
1166
1175
  *
@@ -1726,6 +1735,8 @@ export declare abstract class AbstractSourceWithLayers<SOURCE_SPEC extends Sourc
1726
1735
  _updateSourceAndLayerIDs(): void;
1727
1736
  private isLayerVisible;
1728
1737
  setLayersVisible(visible: boolean, filter?: LayerSpecFilter): void;
1738
+ restoreLayersVisibility(filter?: LayerSpecFilter): void;
1739
+ private writeLayersVisibility;
1729
1740
  get sourceAndLayerIDs(): SourceWithLayerIDs;
1730
1741
  }
1731
1742
  /**
@@ -1777,8 +1788,13 @@ export type GeoJSONSourceClusterOptions = Pick<GeoJSONSourceSpecification, 'clus
1777
1788
  */
1778
1789
  export declare class GeoJSONSourceWithLayers<T extends FeatureCollection = FeatureCollection> extends AddedSourceWithLayers<GeoJSONSourceSpecification, GeoJSONSource> {
1779
1790
  shownFeatures: T;
1791
+ private readonly showListeners;
1780
1792
  constructor(map: Map, sourceId: string, layerSpecs: ToBeAddedLayerSpecWithoutSource[], addLayersToMap?: boolean, clusterOptions?: GeoJSONSourceClusterOptions);
1781
1793
  show(featureCollection: T, { automaticVisibility }?: ShowOptions): void;
1794
+ /**
1795
+ * Calls `listener` after every `show`, including the ones an event-state change makes.
1796
+ */
1797
+ onShow(listener: () => void): void;
1782
1798
  /**
1783
1799
  * Canonical id-based lookup into `shownFeatures.features` via {@link findFeatureByRefId}
1784
1800
  * (first match wins on duplicate ids). Returns `undefined` for a nullish or absent id.
@@ -2059,6 +2075,18 @@ type HoverEventType = 'hover' | 'hover-move' | 'long-hover';
2059
2075
  * @group User Interaction Events
2060
2076
  */
2061
2077
  type EventType = ClickEventType | HoverEventType;
2078
+ /**
2079
+ * The state a feature carries in `properties.eventState`: the user event it is in, or
2080
+ * `recently-hovered` for a moment after the pointer leaves it.
2081
+ *
2082
+ * @remarks
2083
+ * `recently-hovered` lasts {@link EventHandlerHoverConfig.hoverGracePeriodMS}, then clears on its own
2084
+ * unless the feature is hovered or clicked again first. The SDK's own layers draw it as no state;
2085
+ * read it to keep something shown while the pointer travels, as the entry points of places do.
2086
+ *
2087
+ * @group User Interaction Events
2088
+ */
2089
+ type EventState = EventType | 'recently-hovered';
2062
2090
  /**
2063
2091
  * Parameters to identify a feature by its ID or index in a given features array.
2064
2092
  * @group User Interaction Events
@@ -2239,7 +2267,7 @@ type CleanEventStatesOptions = {
2239
2267
  * states: ['click', 'contextmenu', 'hover', 'long-hover']
2240
2268
  * ```
2241
2269
  */
2242
- states?: EventType[];
2270
+ states?: EventState[];
2243
2271
  /**
2244
2272
  * Whether to show the feature after cleaning the event state.
2245
2273
  *
@@ -2286,11 +2314,12 @@ type SupportsEvents = {
2286
2314
  * @remarks
2287
2315
  * - `undefined`: No active event state (normal appearance)
2288
2316
  * - Event type: Active state that affects styling and behavior
2317
+ * - `recently-hovered`: The pointer just left the feature; see {@link EventState}
2289
2318
  *
2290
2319
  * This property is automatically managed by the SDK based on user
2291
2320
  * interactions and programmatic state changes.
2292
2321
  */
2293
- eventState?: EventType;
2322
+ eventState?: EventState;
2294
2323
  };
2295
2324
  /**
2296
2325
  * Handler function for user interaction events on map features.
@@ -2387,103 +2416,66 @@ type EventHandlerCursorConfig = {
2387
2416
  */
2388
2417
  cursorOnHover?: CSSCursor;
2389
2418
  };
2419
+ /**
2420
+ * Event configuration options related to hover states.
2421
+ *
2422
+ * @group User Interaction Events
2423
+ */
2424
+ type EventHandlerHoverConfig = {
2425
+ /**
2426
+ * How long, in milliseconds, a feature stays `recently-hovered` after the pointer leaves it.
2427
+ * `0` clears its state at once.
2428
+ *
2429
+ * @remarks
2430
+ * Set on the map (`events` of the map parameters) for every module, or on one module's
2431
+ * `events` config to override it there.
2432
+ *
2433
+ * @default 400
2434
+ */
2435
+ hoverGracePeriodMS?: number;
2436
+ };
2390
2437
  /**
2391
2438
  * Optional events configuration for a map module.
2392
2439
  *
2393
2440
  * @group User Interaction Events
2394
2441
  */
2395
- type EventHandlerConfig = EventHandlerCursorConfig;
2442
+ type EventHandlerConfig = EventHandlerCursorConfig & EventHandlerHoverConfig;
2396
2443
  //#endregion
2397
2444
  //#region src/shared/types/filters.d.ts
2398
2445
  /**
2399
- * Filter mode determining whether to include or exclude specified values.
2400
- *
2401
- * @remarks
2402
- * Controls how the values list is interpreted:
2403
- * - `all_except`: Show everything except the specified values (exclusion mode)
2404
- * - `only`: Show only the specified values, hide everything else (inclusion mode)
2405
- *
2406
- * @example
2407
- * ```typescript
2408
- * // Exclusion mode
2409
- * const mode: FilterShowMode = 'all_except';
2410
- *
2411
- * // Inclusion mode
2412
- * const mode: FilterShowMode = 'only';
2413
- * ```
2446
+ * Every {@link FilterShowMode}, for validating one at runtime.
2414
2447
  *
2415
2448
  * @group Shared
2416
2449
  */
2417
- type FilterShowMode = 'all_except' | 'only';
2450
+ export declare const filterShowModes: readonly ["only", "all-except"];
2418
2451
  /**
2419
- * Generic filter configuration for showing or hiding items by value.
2452
+ * How a {@link ValuesFilter} reads its `values`:
2453
+ * - `only`: show only these values, hide everything else
2454
+ * - `all-except`: show everything except these values
2420
2455
  *
2421
- * Provides a flexible way to control visibility of categorized items (e.g., POI categories,
2422
- * layer groups, road types) using either inclusion or exclusion mode.
2423
- *
2424
- * @typeParam T - The type of values being filtered (e.g., string literals, enums)
2425
- *
2426
- * @remarks
2427
- * **Filter Modes:**
2428
- * - `only`: Whitelist mode - only specified values are shown
2429
- * - `all_except`: Blacklist mode - all values except specified ones are shown
2456
+ * @group Shared
2457
+ */
2458
+ export type FilterShowMode = (typeof filterShowModes)[number];
2459
+ /**
2460
+ * Shows or hides items by value — POI categories, traffic road categories, incident magnitudes.
2430
2461
  *
2431
- * **Common Use Cases:**
2432
- * - Filtering POI categories (show only restaurants)
2433
- * - Hiding map layer groups (hide all except roads)
2434
- * - Filtering traffic incidents by type
2435
- * - Controlling road categories in traffic flow
2462
+ * @typeParam T - The type of values being filtered
2436
2463
  *
2437
2464
  * @example
2438
2465
  * ```typescript
2439
- * // Show only specific categories
2440
- * const includeFilter: ValuesFilter<string> = {
2441
- * show: 'only',
2442
- * values: ['RESTAURANT', 'CAFE', 'BAR']
2443
- * };
2444
- *
2445
- * // Hide specific categories
2446
- * const excludeFilter: ValuesFilter<string> = {
2447
- * show: 'all_except',
2448
- * values: ['PARKING_GARAGE']
2449
- * };
2466
+ * // Show only these categories
2467
+ * const includeFilter: ValuesFilter<string> = { show: 'only', values: ['RESTAURANT', 'CAFE', 'BAR'] };
2450
2468
  *
2451
- * // Type-safe with string literals
2452
- * type RoadType = 'motorway' | 'trunk' | 'primary';
2453
- * const roadFilter: ValuesFilter<RoadType> = {
2454
- * show: 'only',
2455
- * values: ['motorway', 'trunk']
2456
- * };
2469
+ * // Hide these categories
2470
+ * const excludeFilter: ValuesFilter<string> = { show: 'all-except', values: ['PARKING_GARAGE'] };
2457
2471
  * ```
2458
2472
  *
2459
2473
  * @group Shared
2460
2474
  */
2461
- type ValuesFilter<T> = {
2462
- /**
2463
- * Filter mode determining whether values list is inclusive or exclusive.
2464
- *
2465
- * @remarks
2466
- * - `only`: Shows only the items in the values array (whitelist)
2467
- * - `all_except`: Shows all items except those in the values array (blacklist)
2468
- */
2475
+ export type ValuesFilter<T> = {
2476
+ /** Whether `values` is the set to show or the set to hide. */
2469
2477
  show: FilterShowMode;
2470
- /**
2471
- * Array of values to include or exclude based on the show mode.
2472
- *
2473
- * @remarks
2474
- * The interpretation of this array depends on the `show` property:
2475
- * - If `show` is `'only'`, only these values will be visible
2476
- * - If `show` is `'all_except'`, these values will be hidden
2477
- *
2478
- * @example
2479
- * ```typescript
2480
- * // Include only these values
2481
- * values: ['RESTAURANT', 'HOTEL']
2482
- *
2483
- * // Exclude these values
2484
- * values: ['PARKING']
2485
- * ```
2486
- */
2478
+ /** The values to show or hide, depending on `show`. */
2487
2479
  values: T[];
2488
2480
  };
2489
2481
  //#endregion
@@ -2535,9 +2527,9 @@ type CustomImage<I extends string = string> = {
2535
2527
  *
2536
2528
  * This ID is used to reference the icon when styling map features.
2537
2529
  * The specific values depend on the context:
2538
- * - For POI categories: Use MapStylePOICategory values (e.g., 'RESTAURANT', 'HOTEL_MOTEL')
2530
+ * - For POI categories: Use MapStylePOICategory values (e.g., 'RESTAURANT', 'HOTEL_OR_MOTEL')
2539
2531
  * - For route waypoints: Use waypoint identifiers (e.g., 'waypoint-start', 'waypoint-end')
2540
- * - For charging stations: Use station type identifiers (e.g., 'ELECTRIC_VEHICLE_STATION')
2532
+ * - For charging stations: Use station type identifiers (e.g., 'CHARGING_LOCATION')
2541
2533
  * - For custom markers: Use any unique string identifier
2542
2534
  */
2543
2535
  id: I;
@@ -2605,12 +2597,12 @@ type CustomImage<I extends string = string> = {
2605
2597
  * // Define custom icons for both availability states
2606
2598
  * categoryIcons: [
2607
2599
  * {
2608
- * id: 'ELECTRIC_VEHICLE_STATION',
2600
+ * id: 'CHARGING_LOCATION',
2609
2601
  * image: greenChargingSVG,
2610
2602
  * availabilityLevel: 'available'
2611
2603
  * },
2612
2604
  * {
2613
- * id: 'ELECTRIC_VEHICLE_STATION',
2605
+ * id: 'CHARGING_LOCATION',
2614
2606
  * image: redChargingSVG,
2615
2607
  * availabilityLevel: 'occupied'
2616
2608
  * }
@@ -3090,14 +3082,20 @@ export declare class EventsProxy extends AbstractEventProxy {
3090
3082
  private hoveringFeatures?;
3091
3083
  private hoveringSourceWithLayers?;
3092
3084
  private longHoverTimeoutHandlerID?;
3085
+ private readonly recentHoverTimeouts;
3093
3086
  private firstDelayedHoverSinceMapMove;
3094
3087
  private lastClickedFeature?;
3095
3088
  private lastClickedSourceWithLayers?;
3096
3089
  private lastCursorStyle;
3097
3090
  private pendingMouseMove?;
3098
3091
  private mouseMoveFrameRequested;
3099
- private readonly config;
3092
+ private config;
3100
3093
  constructor(map: Map, config?: MapEventsConfig);
3094
+ /**
3095
+ * Merges `config` into the current configuration; what it leaves out, or sets `undefined`,
3096
+ * keeps its value. Timers already running keep the delay they started with.
3097
+ */
3098
+ updateConfig(config: MapEventsConfig): void;
3101
3099
  private listenToEvents;
3102
3100
  enable(enabled: boolean): void;
3103
3101
  private toPaddedBounds;
@@ -3143,6 +3141,8 @@ export declare class EventsProxy extends AbstractEventProxy {
3143
3141
  private dispatchHoverEnter;
3144
3142
  private dispatchHoverMove;
3145
3143
  private dispatchToHandlers;
3144
+ private hoverGracePeriodFor;
3145
+ private clearRecentHoverLater;
3146
3146
  private updateHoverCursor;
3147
3147
  private onMapClick;
3148
3148
  }
@@ -4112,9 +4112,8 @@ export declare abstract class AbstractStyleOwnedMapModule<SOURCES_WITH_LAYERS ex
4112
4112
  * The kind of value a display knob takes.
4113
4113
  *
4114
4114
  * @remarks
4115
- * One vocabulary for every knob catalogue in the SDK — map styling and any module that describes
4116
- * its display as knobs draw from the same set, so an agent that learned one catalogue can read the
4117
- * other.
4115
+ * One vocabulary for every knob catalogue in the SDK and its plugins, so a UI or an agent that
4116
+ * learned one catalogue can read the other.
4118
4117
  *
4119
4118
  * - `toggle`: `true`/`false`, e.g. whether an overlay is drawn.
4120
4119
  * - `factor`: a multiplier over what the style already does (`1` = unchanged).
@@ -4137,77 +4136,6 @@ export type KnobRange = {
4137
4136
  max: number;
4138
4137
  step?: number;
4139
4138
  };
4140
- /**
4141
- * A single, machine-readable description of one display knob.
4142
- *
4143
- * @remarks
4144
- * The point of describing knobs as data is that a caller — increasingly a coding agent rather than
4145
- * a person reading docs — can ask what a module actually exposes instead of guessing layer ids from
4146
- * training data. Three things follow from having it:
4147
- *
4148
- * - **ground before generating** — write against what the module exposes, not what you remember;
4149
- * - **validate** — ranges and allowed values arrive as data, so a bad value is caught before it
4150
- * is rendered;
4151
- * - **report and diff** — the paired settings object is plain and serializable, so a display change
4152
- * is reviewable in a pull request.
4153
- *
4154
- * A visual editor cannot do any of those: it cannot be read, diffed, or put in a pull request.
4155
- *
4156
- * Modules narrow this shape with their own descriptor type — e.g. `StylingKnobDescriptor` requires
4157
- * `available` and `appliesTo`, while a module whose knobs are always applicable omits them.
4158
- *
4159
- * @group Shared
4160
- */
4161
- export type KnobDescriptor<T = unknown> = {
4162
- /**
4163
- * Stable, dotted identifier, e.g. `labels.sizeFactor`. Treat these as public API: they are what
4164
- * a caller stores, diffs and passes back.
4165
- */
4166
- id: string;
4167
- /** What kind of value the knob takes. */
4168
- kind: KnobKind;
4169
- /** One-line description of what turning this knob does. */
4170
- description: string;
4171
- /** The value in force when nothing has been configured. */
4172
- default: T;
4173
- /** The value in force now. */
4174
- current: T;
4175
- /** Whether {@link KnobDescriptor.current} came from configuration rather than the default. */
4176
- overridden: boolean;
4177
- /** Inclusive bounds, for `factor` and `number` knobs. */
4178
- range?: KnobRange;
4179
- /** The allowed values, for `enum` knobs; the names accepted besides CSS colours, for `colors` knobs. */
4180
- options?: readonly string[];
4181
- /**
4182
- * Whether the knob has anything to work on in the loaded style. Omitted by modules whose knobs
4183
- * are always applicable; set to `false` by modules where a knob can be present in the catalogue
4184
- * but do nothing on the current style.
4185
- */
4186
- available?: boolean;
4187
- /**
4188
- * Which styles or contexts the knob works in. A string rather than a fixed union so each
4189
- * module can choose its own vocabulary — styling uses `'any-style' | 'tomtom-styles'`.
4190
- */
4191
- appliesTo?: string;
4192
- };
4193
- /**
4194
- * Builds one knob descriptor, working out `overridden` from whether a configured value was given.
4195
- * Pass `available` / `appliesTo` / `range` / `options` through `extra` when the module uses them.
4196
- * @ignore
4197
- */
4198
- export declare const knob: <T, ID extends string, KIND extends KnobKind, Extra extends object = Record<string, never>>(id: ID, kind: KIND, description: string, defaultValue: T, configured: T | undefined, extra?: Extra) => KnobDescriptor<T> & {
4199
- id: ID;
4200
- kind: KIND;
4201
- } & Extra;
4202
- /**
4203
- * Reduces a knob catalogue to a plain, serializable object of the values in force.
4204
- *
4205
- * @remarks
4206
- * Only knobs whose value was configured are included, so the result is a diff against the defaults
4207
- * rather than a dump of everything — which is what makes it reviewable.
4208
- * @ignore
4209
- */
4210
- export declare const knobSettings: (knobs: KnobDescriptor[]) => Record<string, unknown>;
4211
4139
  //#endregion
4212
4140
  //#region src/shared/layers/commonLayerProps.d.ts
4213
4141
  /**
@@ -4445,6 +4373,16 @@ export declare const TRAFFIC_INCIDENTS_SOURCE_ID = "vectorTilesIncidents";
4445
4373
  export declare const TRAFFIC_FLOW_SOURCE_ID = "vectorTilesFlow";
4446
4374
  //#endregion
4447
4375
  //#region src/shared/sharedInstance.d.ts
4376
+ /**
4377
+ * The shared instance of a style-owned module for this map if it has already been built — for a
4378
+ * module that writes through another one and cannot await it at that point. `undefined` before the
4379
+ * first `get()` resolves, or when the style could not provide the module.
4380
+ *
4381
+ * @ignore
4382
+ */
4383
+ export declare const sharedInstanceIfCreated: <MODULE>(map: TomTomMap, moduleClass: Function & {
4384
+ prototype: MODULE;
4385
+ }) => MODULE | undefined;
4448
4386
  /**
4449
4387
  * Returns the shared instance of a style-owned module for this map, building it on first use.
4450
4388
  *
@@ -4742,6 +4680,10 @@ export type BaseMapEvents = CombinedEvents<MapGeoJSONFeature, BaseMapModuleConfi
4742
4680
  * buildings, labels, and other vector tile layers from the base map style.
4743
4681
  *
4744
4682
  * @remarks
4683
+ * **What this module owns:** whether each base-map layer group is shown. How the base map looks is
4684
+ * {@link StylingModule} knobs, whose `basemap.<group>` and `buildings.*` toggles write through this module.
4685
+ * See [Who owns what](https://docs.tomtom.com/maps-sdk-js/guides/map/modules#who-owns-what).
4686
+ *
4745
4687
  * **Managed Layers:**
4746
4688
  * - Background and land cover
4747
4689
  * - Water bodies and coastlines
@@ -4978,6 +4920,13 @@ export declare class BaseMapModule extends AbstractStyleOwnedMapModule<BaseSourc
4978
4920
  layerGroups?: BaseMapLayerGroups;
4979
4921
  }): void;
4980
4922
  private _setVisible;
4923
+ /**
4924
+ * The write behind a `basemap.<group>` / `buildings.*` styling knob, over the layers `setVisible`
4925
+ * reaches; `undefined` restores the style's own visibility. The knob keeps the setting, so this
4926
+ * module's config is left alone.
4927
+ * @ignore
4928
+ */
4929
+ _applyKnobVisibility(group: BaseMapLayerGroupName, visible: boolean | undefined): void;
4981
4930
  /**
4982
4931
  * The base-map layer ids grouped by {@link BaseMapLayerGroupName}, for the
4983
4932
  * layers this module manages in the current style.
@@ -6222,18 +6171,12 @@ export declare class GeometriesModule extends AbstractDataOwnedMapModule<Geometr
6222
6171
  * ```
6223
6172
  *
6224
6173
  * @example
6225
- * From search API response:
6174
+ * From a place's geometry:
6226
6175
  * ```typescript
6227
- * import { search } from '@tomtom-org/maps-sdk/services';
6228
- *
6229
- * const result = await search.geometrySearch({
6230
- * query: 'Amsterdam',
6231
- * geometryList: [{ type: 'CIRCLE', position: [52.37, 4.89], radius: 5000 }]
6232
- * });
6176
+ * import { geocodeOne, geometryData } from '@tomtom-org/maps-sdk/services';
6233
6177
  *
6234
- * if (result.results[0].dataSources?.geometry) {
6235
- * await geometries.show(result.results[0].dataSources.geometry);
6236
- * }
6178
+ * const amsterdam = await geocodeOne('Amsterdam');
6179
+ * await geometries.show(await geometryData({ geometries: [amsterdam] }));
6237
6180
  * ```
6238
6181
  */
6239
6182
  show(geometries: PolygonFeatures): Promise<void>;
@@ -6723,6 +6666,45 @@ export type PlaceDisplayProps = {
6723
6666
  */
6724
6667
  export type DisplayPlaceProps = CommonPlaceProps & PlaceDisplayProps;
6725
6668
  //#endregion
6669
+ //#region src/places/types/entryPointDisplay.d.ts
6670
+ /**
6671
+ * Properties of an entry point drawn by {@link PlacesModule}: the {@link EntryPoint} itself, whose
6672
+ * position is the feature geometry, plus where it came from.
6673
+ *
6674
+ * @group Places
6675
+ */
6676
+ type PlaceEntryPointProps = Omit<EntryPoint, 'position'> & {
6677
+ /**
6678
+ * Unique identifier of the entry point feature, derived from its place.
6679
+ */
6680
+ id: string;
6681
+ /**
6682
+ * `id` of the place the entry point belongs to, as shown by the module.
6683
+ */
6684
+ placeID: string;
6685
+ /**
6686
+ * Index of the entry point in the `entryPoints` of its place.
6687
+ */
6688
+ entryPointIndex: number;
6689
+ } & SupportsEvents;
6690
+ /**
6691
+ * What `places.events.entryPoints` handlers receive: the entry point as a point feature, whether its
6692
+ * circle or its line was hit, together with the place it belongs to.
6693
+ *
6694
+ * @remarks
6695
+ * The place is passed as shown, with its own geometry. To route to the entrance, pass this feature
6696
+ * as the route location.
6697
+ *
6698
+ * @group Places
6699
+ */
6700
+ type PlaceEntryPointFeature = Feature<Point, PlaceEntryPointProps & {
6701
+ /**
6702
+ * The place the entry point belongs to. Absent only when that place left the map while the
6703
+ * event was being handled.
6704
+ */
6705
+ place?: Place<DisplayPlaceProps>;
6706
+ }>;
6707
+ //#endregion
6726
6708
  //#region src/places/types/placesModuleConfig.d.ts
6727
6709
  /**
6728
6710
  * Icon style options for displaying places on the map.
@@ -6765,7 +6747,7 @@ export declare const placesThemes: readonly ["pin", "circle-icon", "base-map", "
6765
6747
  * const places = await PlacesModule.create(map, {
6766
6748
  * evAvailability: { enabled: true }
6767
6749
  * });
6768
- * const stations = await search({ poiCategories: ['ELECTRIC_VEHICLE_STATION'] });
6750
+ * const stations = await discoverPlaces({ poiCategories: ['CHARGING_LOCATION'] });
6769
6751
  * places.show(await getPlacesWithEVAvailability(stations));
6770
6752
  *
6771
6753
  * // Custom threshold and format
@@ -6781,7 +6763,7 @@ export declare const placesThemes: readonly ["pin", "circle-icon", "base-map", "
6781
6763
  * const places = await PlacesModule.create(map, {
6782
6764
  * icon: {
6783
6765
  * categoryIcons: [{
6784
- * id: 'ELECTRIC_VEHICLE_STATION',
6766
+ * id: 'CHARGING_LOCATION',
6785
6767
  * image: customEvIconSvg,
6786
6768
  * pixelRatio: 2
6787
6769
  * }]
@@ -6865,7 +6847,7 @@ type DefaultPlaceIconConfig = {
6865
6847
  * const iconConfig: PlaceIconConfig = {
6866
6848
  * categoryIcons: [
6867
6849
  * { category: 'RESTAURANT', image: '/icons/food.png', pixelRatio: 2 },
6868
- * { category: 'HOTEL_MOTEL', image: '/icons/hotel.png', pixelRatio: 2 }
6850
+ * { category: 'HOTEL_OR_MOTEL', image: '/icons/hotel.png', pixelRatio: 2 }
6869
6851
  * ]
6870
6852
  * };
6871
6853
  * ```
@@ -7280,6 +7262,81 @@ type PlaceConnectionsConfig = {
7280
7262
  */
7281
7263
  layers?: PlaceConnectionsLayersConfig;
7282
7264
  };
7265
+ /**
7266
+ * Which shown places get their entry points drawn.
7267
+ *
7268
+ * @remarks
7269
+ * - `all`: every place that has entry points.
7270
+ * - `selected`: hovered or clicked places, the ones the `selected` layer highlights. A
7271
+ * `recently-hovered` place counts too, so the pointer can cross the map to an entrance.
7272
+ * - `clicked`: clicked places, which stay clicked until the next click lands elsewhere.
7273
+ *
7274
+ * `selected` and `clicked` follow the module's event states, which exist once an event handler is
7275
+ * registered on the module or {@link PlacesModule.putEventState} is called. Hovering or clicking an
7276
+ * entry point keeps the entry points of its place drawn when a handler covers them: one on `events`
7277
+ * or `events.entryPoints`, not on `events.places` alone.
7278
+ *
7279
+ * @group Places
7280
+ */
7281
+ type PlaceEntryPointsShowFor = 'all' | 'selected' | 'clicked';
7282
+ /**
7283
+ * MapLibre layer customization for entry points.
7284
+ *
7285
+ * @remarks
7286
+ * The layer IDs are derived from the PlacesModule instance prefix:
7287
+ * - `point`: a circle on each entry point, larger for a `main` one than for the rest
7288
+ * - `line`: a dotted line from the place to each of its entry points
7289
+ *
7290
+ * @group Places
7291
+ */
7292
+ type PlaceEntryPointsLayersConfig = {
7293
+ /**
7294
+ * Entry point circle layer specification.
7295
+ */
7296
+ point?: Partial<ToBeAddedLayerSpecTemplate<CircleLayerSpecification>>;
7297
+ /**
7298
+ * Place-to-entry-point line layer specification.
7299
+ */
7300
+ line?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
7301
+ };
7302
+ /**
7303
+ * Configuration for drawing the entry points (entrances) of the shown places.
7304
+ *
7305
+ * @remarks
7306
+ * Draws `properties.entryPoints` of each place, whichever service returned it.
7307
+ *
7308
+ * @example
7309
+ * ```typescript
7310
+ * const places = await PlacesModule.create(map, {
7311
+ * entryPoints: { showFor: 'clicked', minZoom: 16 }
7312
+ * });
7313
+ * // The handler is what makes places clickable, and so what lets them reach the `click` state.
7314
+ * places.events.on('click', (feature) => console.log(feature.properties.title));
7315
+ * ```
7316
+ *
7317
+ * @group Places
7318
+ */
7319
+ type PlaceEntryPointsConfig = {
7320
+ /**
7321
+ * Which places get their entry points drawn.
7322
+ *
7323
+ * @default 'selected'
7324
+ */
7325
+ showFor?: PlaceEntryPointsShowFor;
7326
+ /**
7327
+ * Zoom level below which no entry point is drawn.
7328
+ *
7329
+ * @remarks
7330
+ * Under the `pin-clustered` theme it is never lower than 18, the first zoom without clusters.
7331
+ *
7332
+ * @default 15
7333
+ */
7334
+ minZoom?: number;
7335
+ /**
7336
+ * Custom MapLibre layer specifications for the entry point circles and lines.
7337
+ */
7338
+ layers?: PlaceEntryPointsLayersConfig;
7339
+ };
7283
7340
  /**
7284
7341
  * Configuration options for the PlacesModule.
7285
7342
  *
@@ -7374,6 +7431,13 @@ type PlacesModuleConfig<P extends CommonPlaceProps = CommonPlaceProps> = MapModu
7374
7431
  * (a dashed line) and no label.
7375
7432
  */
7376
7433
  connections?: PlaceConnectionsConfig;
7434
+ /**
7435
+ * Configuration for drawing the entry points of the shown places.
7436
+ *
7437
+ * @remarks
7438
+ * When omitted, entry points are not drawn.
7439
+ */
7440
+ entryPoints?: PlaceEntryPointsConfig;
7377
7441
  /**
7378
7442
  * Additional properties to compute for each place feature.
7379
7443
  *
@@ -7442,6 +7506,14 @@ type ConnectionFeatureProps = {
7442
7506
  */
7443
7507
  type ConnectionFeatureCollection = FeatureCollection<LineString, ConnectionFeatureProps>;
7444
7508
  //#endregion
7509
+ //#region src/places/utils/prepareEntryPointsForDisplay.d.ts
7510
+ /**
7511
+ * Each entry point is two features sharing one id: its circle, then its line. The circle comes
7512
+ * first, so an id lookup (event states, event payloads) always lands on it.
7513
+ * @ignore
7514
+ */
7515
+ type EntryPointFeatureCollection = FeatureCollection<Point | LineString, PlaceEntryPointProps>;
7516
+ //#endregion
7445
7517
  //#region src/places/PlacesModule.d.ts
7446
7518
  type PlacesSourcesAndLayers = {
7447
7519
  /**
@@ -7463,6 +7535,10 @@ type PlacesSourcesAndLayers = {
7463
7535
  * Connections source id with corresponding layers ids (line + label).
7464
7536
  */
7465
7537
  connections: GeoJSONSourceWithLayers<ConnectionFeatureCollection>;
7538
+ /**
7539
+ * Entry points source id with corresponding layers ids (line + point).
7540
+ */
7541
+ entryPoints: GeoJSONSourceWithLayers<EntryPointFeatureCollection>;
7466
7542
  };
7467
7543
  /**
7468
7544
  * What {@link PlacesModule.show} accepts, and what `shown-features` handlers receive back.
@@ -7492,14 +7568,19 @@ export type PlacesEvents = CombinedEvents<MapGeoJSONFeature, PlacesModuleConfig,
7492
7568
  places: UserEvents<Place<DisplayPlaceProps>>;
7493
7569
  /** The lines and labels connecting places to their parent, when connections are shown. */
7494
7570
  connections: UserEvents<MapGeoJSONFeature>;
7571
+ /** The entry points of places, when {@link PlacesModuleConfig.entryPoints} draws them. */
7572
+ entryPoints: UserEvents<PlaceEntryPointFeature>;
7495
7573
  };
7496
7574
  export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourcesAndLayers, PlacesModuleConfig> {
7497
7575
  private layerSpecs;
7498
7576
  private connectionLayerSpecs;
7577
+ private entryPointLayerSpecs;
7578
+ private refreshingEntryPoints;
7499
7579
  private currentClusterMode;
7500
7580
  private sourceID;
7501
7581
  private unclusteredSourceID;
7502
7582
  private connectionSourceID;
7583
+ private entryPointSourceID;
7503
7584
  private layerIDPrefix;
7504
7585
  private defaultPlaceIconID;
7505
7586
  private shownConnections;
@@ -7521,10 +7602,13 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
7521
7602
  * @ignore
7522
7603
  */
7523
7604
  protected _initSourcesWithLayers(config?: PlacesModuleConfig, restore?: boolean): PlacesSourcesAndLayers;
7605
+ private addOverlaySource;
7606
+ private replaceLayerSpecs;
7524
7607
  private partitionSpecsForSources;
7525
7608
  private buildLayerSpecs;
7526
7609
  private buildClusterOptions;
7527
7610
  private buildConnectionLayerSpecs;
7611
+ private buildEntryPointLayerSpecs;
7528
7612
  /**
7529
7613
  * @ignore
7530
7614
  */
@@ -7629,8 +7713,9 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
7629
7713
  applyExtraFeatureProps<P extends CommonPlaceProps = CommonPlaceProps>(extraFeatureProps: NonNullable<PlacesModuleConfig<P>['extraFeatureProps']>): void;
7630
7714
  private updateLayersAndData;
7631
7715
  private rebuildSourcesAndLayers;
7632
- private updateConnectionLayersAndData;
7633
7716
  private updateConnectionsData;
7717
+ private updateEntryPointsData;
7718
+ private applyLayersVisibility;
7634
7719
  private applyPlacesVisibility;
7635
7720
  private setupImages;
7636
7721
  private updateData;
@@ -7655,9 +7740,9 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
7655
7740
  * @example
7656
7741
  * Display search results:
7657
7742
  * ```typescript
7658
- * import { search } from '@tomtom-org/maps-sdk/services';
7743
+ * import { discoverPlaces } from '@tomtom-org/maps-sdk/services';
7659
7744
  *
7660
- * const results = await search({ query: 'coffee' });
7745
+ * const results = await discoverPlaces({ query: 'coffee' });
7661
7746
  * await placesModule.show(results);
7662
7747
  * ```
7663
7748
  *
@@ -7971,13 +8056,13 @@ export type POICategoryGroup = keyof typeof poiCategoryGroups;
7971
8056
  /**
7972
8057
  * A POI classification or group that can be filtered.
7973
8058
  *
7974
- * Can be either a specific POI category (like RESTAURANT, HOTEL_MOTEL) or a
8059
+ * Can be either a specific POI category (like RESTAURANT, HOTEL_OR_MOTEL) or a
7975
8060
  * broader category group (like FOOD_DRINKS_GROUP, SHOPPING_GROUP) that contains
7976
8061
  * multiple related categories.
7977
8062
  *
7978
8063
  * @remarks
7979
8064
  * **Category vs Group:**
7980
- * - Category: Specific POI type (e.g., RESTAURANT, GAS_STATION)
8065
+ * - Category: Specific POI type (e.g., RESTAURANT, FUEL_STATION)
7981
8066
  * - Group: Collection of related categories (e.g., FOOD_DRINKS_GROUP includes restaurants, cafes, bars)
7982
8067
  *
7983
8068
  * Using groups is more convenient when you want to filter multiple related categories at once.
@@ -8024,7 +8109,7 @@ type FilterablePOICategory = MapStylePOICategory | POICategoryGroup;
8024
8109
  * const noParkingConfig: POIsModuleConfig = {
8025
8110
  * filters: {
8026
8111
  * categories: {
8027
- * show: 'all_except',
8112
+ * show: 'all-except',
8028
8113
  * values: ['PARKING_GROUP']
8029
8114
  * }
8030
8115
  * }
@@ -8058,25 +8143,20 @@ type POIsModuleConfig = MapModuleCommonConfig & {
8058
8143
  */
8059
8144
  filters?: {
8060
8145
  /**
8061
- * Category filter configuration.
8062
- *
8063
- * @remarks
8064
- * By default, all categories are included in the map.
8065
- * - Use `all_except` show mode to hide some categories/groups
8066
- * - Use `only` mode to show only specific categories/groups and hide everything else
8146
+ * Categories or category groups to show or hide, per {@link FilterShowMode}.
8067
8147
  *
8068
8148
  * @example
8069
8149
  * ```typescript
8070
8150
  * // Show only restaurants and hotels
8071
8151
  * categories: {
8072
8152
  * show: 'only',
8073
- * values: ['RESTAURANT', 'HOTEL_MOTEL']
8153
+ * values: ['RESTAURANT', 'HOTEL_OR_MOTEL']
8074
8154
  * }
8075
8155
  *
8076
8156
  * // Hide parking
8077
8157
  * categories: {
8078
- * show: 'all_except',
8079
- * values: ['PARKING_GARAGE', 'OPEN_PARKING_AREA']
8158
+ * show: 'all-except',
8159
+ * values: ['PARKING_GARAGE', 'OPEN_CAR_PARKING_AREA']
8080
8160
  * }
8081
8161
  *
8082
8162
  * // Show only food-related POIs
@@ -8139,7 +8219,7 @@ type POIsModuleFeature = Feature<Point, {
8139
8219
  *
8140
8220
  * @remarks
8141
8221
  * Used for styling and filtering purposes. Maps to a specific POI type
8142
- * (e.g., RESTAURANT, HOTEL_MOTEL).
8222
+ * (e.g., RESTAURANT, HOTEL_OR_MOTEL).
8143
8223
  *
8144
8224
  * @example 'restaurant'
8145
8225
  */
@@ -8191,6 +8271,10 @@ type PoIsSourcesAndLayers = {
8191
8271
  * and include businesses, landmarks, and other points of interest.
8192
8272
  *
8193
8273
  * @remarks
8274
+ * **What this module owns:** whether the style's POIs are shown, and which categories. Their size,
8275
+ * label colours and zoom thresholds are `pois.*` knobs on {@link StylingModule}.
8276
+ * See [Who owns what](https://docs.tomtom.com/maps-sdk-js/guides/map/modules#who-owns-what).
8277
+ *
8194
8278
  * **Features:**
8195
8279
  * - Toggle POI visibility on/off
8196
8280
  * - Filter by POI categories or category groups
@@ -8198,7 +8282,7 @@ type PoIsSourcesAndLayers = {
8198
8282
  * - Based on vector tile data in the map style
8199
8283
  *
8200
8284
  * **POI Categories:**
8201
- * - Individual categories (e.g., RESTAURANT, HOTEL_MOTEL, PARKING_GARAGE)
8285
+ * - Individual categories (e.g., RESTAURANT, HOTEL_OR_MOTEL, PARKING_GARAGE)
8202
8286
  * - Category groups (e.g., FOOD_DRINKS_GROUP, SHOPPING_GROUP, TRANSPORTATION_GROUP)
8203
8287
  *
8204
8288
  * **Difference from PlacesModule:**
@@ -8224,13 +8308,13 @@ type PoIsSourcesAndLayers = {
8224
8308
  * // Show only restaurants and hotels
8225
8309
  * poisModule.filterCategories({
8226
8310
  * show: 'only',
8227
- * values: ['RESTAURANT', 'HOTEL_MOTEL']
8311
+ * values: ['RESTAURANT', 'HOTEL_OR_MOTEL']
8228
8312
  * });
8229
8313
  *
8230
8314
  * // Hide parking garages
8231
8315
  * poisModule.filterCategories({
8232
- * show: 'all_except',
8233
- * values: ['PARKING_GARAGE', 'OPEN_PARKING_AREA']
8316
+ * show: 'all-except',
8317
+ * values: ['PARKING_GARAGE', 'OPEN_CAR_PARKING_AREA']
8234
8318
  * });
8235
8319
  * ```
8236
8320
  *
@@ -8245,7 +8329,7 @@ type PoIsSourcesAndLayers = {
8245
8329
  *
8246
8330
  * // Hide transportation POIs
8247
8331
  * pois.filterCategories({
8248
- * show: 'all_except',
8332
+ * show: 'all-except',
8249
8333
  * values: ['TRANSPORTATION_GROUP']
8250
8334
  * });
8251
8335
  * ```
@@ -8350,32 +8434,8 @@ export declare class POIsModule extends AbstractStyleOwnedMapModule<PoIsSourcesA
8350
8434
  /**
8351
8435
  * Filters POIs by category or category group.
8352
8436
  *
8353
- * @param categoriesFilter - Filter configuration specifying which categories to show/hide.
8354
- * Pass `undefined` to reset to default (show all).
8355
- *
8356
- * @remarks
8357
- * **Filter Modes:**
8358
- * - `only`: Show only the specified categories, hide all others
8359
- * - `all_except`: Show all categories except the specified ones
8360
- *
8361
- * **Category Types:**
8362
- * - Individual categories (e.g., 'RESTAURANT', 'HOTEL_MOTEL')
8363
- * - Category groups (e.g., 'FOOD_DRINKS_GROUP', 'SHOPPING_GROUP')
8364
- *
8365
- * **Available Category Groups:**
8366
- * - FOOD_DRINKS_GROUP
8367
- * - SHOPPING_GROUP
8368
- * - TRANSPORTATION_GROUP
8369
- * - HEALTH_GROUP
8370
- * - PARKING_GROUP
8371
- * - HOLIDAY_TOURISM_GROUP
8372
- * - EV_CHARGING_STATIONS_GROUP
8373
- * - GAS_STATIONS_GROUP
8374
- * - ACCOMMODATION_GROUP
8375
- * - ENTERTAINMENT_GROUP
8376
- * - SPORTS_LEISURE_GROUP
8377
- * - EDUCATION_GROUP
8378
- * - GOVERNMENT_GROUP
8437
+ * @param categoriesFilter - Categories (`'RESTAURANT'`) or {@link POICategoryGroup | groups}
8438
+ * (`'FOOD_DRINKS_GROUP'`) to show or hide, per {@link FilterShowMode}. `undefined` shows all.
8379
8439
  *
8380
8440
  * @example
8381
8441
  * Show only restaurants:
@@ -8390,7 +8450,7 @@ export declare class POIsModule extends AbstractStyleOwnedMapModule<PoIsSourcesA
8390
8450
  * Hide parking:
8391
8451
  * ```typescript
8392
8452
  * pois.filterCategories({
8393
- * show: 'all_except',
8453
+ * show: 'all-except',
8394
8454
  * values: ['PARKING_GROUP']
8395
8455
  * });
8396
8456
  * ```
@@ -9280,13 +9340,13 @@ type SectionIconConfig = {
9280
9340
  * - `center`: one icon at the middle of each section.
9281
9341
  * - `along`: icons repeated along the section.
9282
9342
  *
9283
- * @defaultValue `"center"`
9343
+ * @defaultValue `"center"` on the generated types; `ferry` and `tollRoad` keep their own placement.
9284
9344
  */
9285
9345
  placement?: 'center' | 'along';
9286
9346
  /**
9287
9347
  * Icon scale, where `1` is the sprite image's own size.
9288
9348
  *
9289
- * @defaultValue 1
9349
+ * @defaultValue `1` on the generated types; `ferry` and `tollRoad` keep their own zoom-ramped size.
9290
9350
  */
9291
9351
  size?: number;
9292
9352
  };
@@ -11038,10 +11098,10 @@ type StyleSources = Record<string, {
11038
11098
  //#endregion
11039
11099
  //#region src/styling/mapColorCatalogue.d.ts
11040
11100
  /**
11041
- * The ten semantic map colours — TomTom Map Maker's *Foundations* palette, under its own names and
11042
- * in its own order. One name drives every layer and shade the style derives from it.
11101
+ * The ten semantic map colours — the *Foundations* palette of TomTom's style themes, under their own
11102
+ * names and in their order. One name drives every layer and shade the style derives from it.
11043
11103
  *
11044
- * | Name | Map Maker | Reaches |
11104
+ * | Name | Theme label | Reaches |
11045
11105
  * |---|---|---|
11046
11106
  * | `land` | Land (base) | Map background and other bare-land features, influences admin borders/labels. Also used to derive all map colours if undefined. |
11047
11107
  * | `water` | Water | Waterbodies, waterways and other water features. Also influences glaciers, water labels and ferry lines. |
@@ -11078,7 +11138,7 @@ declare const paintColorProperties: readonly ["fill-color", "fill-outline-color"
11078
11138
  /** @ignore */
11079
11139
  type PaintColorProperty = (typeof paintColorProperties)[number];
11080
11140
  /**
11081
- * The ten map colour names, in Map Maker's Foundations order.
11141
+ * The ten map colour names, in the themes' Foundations order.
11082
11142
  *
11083
11143
  * @group Map Styling
11084
11144
  */
@@ -11160,6 +11220,13 @@ type StylingPresetId = keyof typeof stylingPresets;
11160
11220
  * @group Map Styling
11161
11221
  */
11162
11222
  export declare const stylingPresetIds: StylingPresetId[];
11223
+ /**
11224
+ * Every styling preset with its name, use case and the knob values it applies, in catalogue order.
11225
+ * Static data: no map is needed to read it.
11226
+ *
11227
+ * @group Map Styling
11228
+ */
11229
+ export declare const stylingPresetCatalogue: readonly StylingPreset[];
11163
11230
  //#endregion
11164
11231
  //#region src/styling/types/stylingTypes.d.ts
11165
11232
  /**
@@ -11208,57 +11275,31 @@ type StylingKnobRange = KnobRange & {
11208
11275
  step: number;
11209
11276
  };
11210
11277
  /**
11211
- * One entry of the styling catalogue returned by {@link StylingModule.describe}: everything a UI or
11212
- * an agent needs to offer the knob, validate a value for it and show its state.
11213
- *
11214
- * @remarks
11215
- * Narrows the shared {@link KnobDescriptor}: styling ids and value types are known, `range.step` is
11216
- * always given, and `available` / `appliesTo` are required — every styling knob answers both.
11278
+ * One entry of {@link stylingKnobCatalogue}: what a UI or a coding agent needs to offer the knob and
11279
+ * validate a value for it, with no map loaded. The value in force is {@link StylingModule.get}.
11217
11280
  *
11218
11281
  * @group Map Styling
11219
11282
  */
11220
- type StylingKnobDescriptor = KnobDescriptor & {
11283
+ type StylingKnob = {
11221
11284
  /** The knob's id, as accepted by {@link StylingModule.set}. */
11222
11285
  id: StylingKnobId;
11223
11286
  kind: StylingKnobKind;
11224
- /**
11225
- * The value the loaded style ships with. `undefined` when the style defines it as a data-driven
11226
- * expression that no single value stands for; `reset` still restores it exactly.
11227
- */
11228
- default: StylingKnobValue | undefined;
11229
- /** The value in effect right now: the override if there is one, otherwise the default. */
11230
- current: StylingKnobValue | undefined;
11287
+ /** One line on what turning the knob does. */
11288
+ description: string;
11231
11289
  /** The range of valid values, for `factor` and `number` knobs. */
11232
11290
  range?: StylingKnobRange;
11233
11291
  /** The valid values, for `enum` knobs. */
11234
11292
  options?: readonly string[];
11235
- /**
11236
- * Whether the knob has anything to work on in the loaded style. `false` means setting it would
11237
- * do nothing, and the SDK also warns once in the console when that happens. Check this before
11238
- * offering the knob in a UI or to an agent. Map-level knobs are always available.
11239
- */
11240
- available: boolean;
11241
11293
  /** Which styles the knob works on; see {@link stylingKnobAppliesTo}. */
11242
11294
  appliesTo: StylingKnobAppliesTo;
11243
11295
  };
11244
- /**
11245
- * The machine-readable styling catalogue: what can be styled on the loaded style, with defaults,
11246
- * ranges and current values. Additive across SDK minor versions; knob ids are public API.
11247
- *
11248
- * @group Map Styling
11249
- */
11250
- type StylingCatalogue = {
11251
- knobs: StylingKnobDescriptor[];
11252
- /** The presets {@link StylingModule.applyPreset} accepts, with the settings each one applies. */
11253
- presets: StylingPresetDescriptor[];
11254
- };
11255
11296
  /**
11256
11297
  * A named bundle of knob settings — TomTom's cartographic opinions, in code. Apply one with
11257
11298
  * {@link StylingModule.applyPreset}.
11258
11299
  *
11259
11300
  * @group Map Styling
11260
11301
  */
11261
- type StylingPresetDescriptor = {
11302
+ type StylingPreset = {
11262
11303
  id: StylingPresetId;
11263
11304
  name: string;
11264
11305
  /** One line on the use case the preset serves. */
@@ -11314,6 +11355,11 @@ type KnobMechanism =
11314
11355
  type: 'visibility';
11315
11356
  layers: LayerSelector[];
11316
11357
  } |
11358
+ /** M2 — shows/hides one of {@link BaseMapModule}'s layer groups, through the module. */
11359
+ {
11360
+ type: 'baseMapGroup';
11361
+ group: BaseMapLayerGroupName;
11362
+ } |
11317
11363
  /**
11318
11364
  * M2 — sets a colour literal on the matched layers; `shades` are layers whose colour the style
11319
11365
  * derived from it (an outline, a tunnel variant) and that are re-derived by the same HSL offset.
@@ -11381,7 +11427,7 @@ type KnobDefinitionOf<KIND extends StylingKnobKind> = KnobDefinition & {
11381
11427
  /**
11382
11428
  * The styling knob catalogue: what the SDK can restyle on a TomTom standard style, and how.
11383
11429
  *
11384
- * Ids are public API — additive only. Ranges follow TomTom Map Maker's validated grammar (factors
11430
+ * Ids are public API — additive only. Ranges follow the validated grammar of TomTom's style editor (factors
11385
11431
  * 0.5–1.5 in 0.1 steps) so a value that looks right in the designer's tool looks right here.
11386
11432
  * @ignore
11387
11433
  */
@@ -11574,7 +11620,7 @@ declare const knobDefinitions: {
11574
11620
  readonly 'colors.labelOutline': KnobDefinitionOf<"color">;
11575
11621
  };
11576
11622
  /**
11577
- * The id of a styling knob — see {@link StylingModule.describe} for what each one does.
11623
+ * The id of a styling knob — see {@link stylingKnobCatalogue} for what each one does.
11578
11624
  *
11579
11625
  * @group Map Styling
11580
11626
  */
@@ -11585,6 +11631,14 @@ type StylingKnobId = keyof typeof knobDefinitions;
11585
11631
  * @group Map Styling
11586
11632
  */
11587
11633
  export declare const stylingKnobIds: StylingKnobId[];
11634
+ /**
11635
+ * Every styling knob with its kind, description, range or options and the styles it works on, in
11636
+ * catalogue order. Static data: a UI or a coding agent reads it with no map loaded, and
11637
+ * {@link StylingModule.get} gives the value in force on a live one.
11638
+ *
11639
+ * @group Map Styling
11640
+ */
11641
+ export declare const stylingKnobCatalogue: readonly StylingKnob[];
11588
11642
  /**
11589
11643
  * The id of a styling knob that holds a colour — every colour the styling module can name, and so
11590
11644
  * resolve against whichever style is loaded.
@@ -11725,23 +11779,26 @@ export type StylingEvents = CombinedEvents<MapGeoJSONFeature, StylingSettings, n
11725
11779
  * hand-editing MapLibre layers.
11726
11780
  *
11727
11781
  * Every adjustable thing is a **knob** with a stable id, a kind, a range and a default read from the
11728
- * loaded style. {@link describe} returns that catalogue as data, so a UI or an AI agent can build
11729
- * controls, validate values and diff state without knowing anything about the style's layers.
11782
+ * loaded style. The ids form the {@link StylingKnobId} union, and {@link stylingKnobCatalogue} lists
11783
+ * each one's kind, range and description as data, with no map needed to read it.
11730
11784
  *
11731
11785
  * @remarks
11732
11786
  * **Which styles a knob works on** is `appliesTo` in the catalogue. `any-style` knobs (sizes,
11733
11787
  * widths) wrap whatever the style already does — `text-size: E` becomes `["*", 1.3, E]` — so they
11734
11788
  * work on a custom style too. `tomtom-styles` knobs (toggles, colours) reach their layers through
11735
- * the TomTom styles this SDK version is verified against; on any other style they report
11736
- * `available: false`, warn once and do nothing rather than failing silently.
11789
+ * the TomTom styles this SDK version is verified against; on any other style setting one warns once
11790
+ * and does nothing, rather than failing silently.
11737
11791
  *
11738
11792
  * **Style changes.** Settings are re-applied after every `setStyle` that carries state over, on top of
11739
11793
  * whatever the other modules restored, and dropped on a clean switch (`resetState: true`).
11740
11794
  *
11741
- * **Interplay with other modules.** Toggles set layer visibility, as {@link BaseMapModule} and
11742
- * {@link POIsModule} do for whole groups; the later call wins. `pois.zoomShift` rewrites the POI
11743
- * layer filters, which {@link POIsModule.filterCategories} also narrows: the two compose, so either
11744
- * can be set at any time and neither drops the other.
11795
+ * **Interplay with other modules.** The base-map group toggles (`basemap.*`, `buildings.*`) write
11796
+ * through {@link BaseMapModule} and `get()` reads their layers live, so it agrees with `isVisible`
11797
+ * and the later call wins; a style change re-applies a set toggle over what the base map restored.
11798
+ *
11799
+ * `pois.zoomShift` rewrites the POI layer filters, which {@link POIsModule.filterCategories} also
11800
+ * narrows: the two compose, so either can be set at any time and neither drops the other.
11801
+ * `pois.microMarkers` and {@link POIsModule.setVisible} both show or hide micro markers: the later call wins.
11745
11802
  *
11746
11803
  * @example
11747
11804
  * ```typescript
@@ -11752,9 +11809,9 @@ export type StylingEvents = CombinedEvents<MapGeoJSONFeature, StylingSettings, n
11752
11809
  * styling.set('roads.exitNumbers', false);
11753
11810
  * styling.set('traffic.flow.slowColor', '#f59e0b');
11754
11811
  *
11755
- * // Everything a control panel or an agent needs, as data:
11756
- * for (const knob of styling.describe().knobs) {
11757
- * console.log(knob.id, knob.kind, knob.range, knob.current);
11812
+ * // The catalogue as data, and each knob's value in force:
11813
+ * for (const knob of stylingKnobCatalogue) {
11814
+ * console.log(knob.id, knob.kind, knob.range, styling.get(knob.id));
11758
11815
  * }
11759
11816
  *
11760
11817
  * // Serializable, diffable, re-applicable:
@@ -11776,6 +11833,7 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
11776
11833
  private mapColorTargetsByKey;
11777
11834
  private mapColorTargetsByKnob;
11778
11835
  private mapColorAnchors;
11836
+ private landDerivedColors;
11779
11837
  private warned;
11780
11838
  private reindexed;
11781
11839
  private originalSpaceColor;
@@ -11828,24 +11886,9 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
11828
11886
  get layers(): {
11829
11887
  query: (query: LayerQuery) => LayerSelection;
11830
11888
  };
11831
- /**
11832
- * The styling catalogue for the loaded style: every knob with its kind, range, default, current
11833
- * value and how many layers it reaches.
11834
- *
11835
- * @remarks
11836
- * Meant to be consumed as data — build a control panel from it, hand it to an agent, or diff two
11837
- * calls. Knob ids and the shape of the entries are public API and change additively only.
11838
- *
11839
- * @example
11840
- * ```typescript
11841
- * const { knobs } = styling.describe();
11842
- * const sliders = knobs.filter((knob) => knob.kind === 'factor' && knob.available);
11843
- * ```
11844
- */
11845
- describe(): StylingCatalogue;
11846
11889
  /**
11847
11890
  * Applies a preset: a named bundle of knob settings the SDK ships for a common intent
11848
- * (`data-viz`, `night-driving`, `minimal`, `globe`). See `describe().presets` for
11891
+ * (`data-viz`, `night-driving`, `minimal`, `globe`). See {@link stylingPresetCatalogue} for
11849
11892
  * what each one sets.
11850
11893
  *
11851
11894
  * @param id - The preset to apply.
@@ -11866,6 +11909,7 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
11866
11909
  }): void;
11867
11910
  /**
11868
11911
  * The value a knob currently has: the override if one is set, otherwise the style's own default.
11912
+ * A base-map group toggle reads its layers instead, so it also reflects `BaseMapModule.setVisible`.
11869
11913
  *
11870
11914
  * @param id - The knob to read.
11871
11915
  * @returns The current value, or `undefined` when the style defines it as a data-driven
@@ -11881,7 +11925,7 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
11881
11925
  * Sets one knob. The value is validated against the knob's kind and range before anything is
11882
11926
  * touched, and applied to every layer the knob reaches.
11883
11927
  *
11884
- * @param id - The knob to set; see {@link describe} for the catalogue.
11928
+ * @param id - The knob to set; see {@link stylingKnobCatalogue} for the catalogue.
11885
11929
  * @param value - A number for `factor`/`number` knobs (within `range`), a boolean for `toggle`
11886
11930
  * knobs, a CSS colour string for `color` knobs.
11887
11931
  * @throws `RangeError` when the value is not valid for the knob; `Error` for an unknown id.
@@ -11907,14 +11951,16 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
11907
11951
  */
11908
11952
  reset(id?: StylingKnobId): void;
11909
11953
  /**
11910
- * Recolours the whole base map with up to ten semantic colours in one call — Map Maker's
11911
- * Foundations palette, each listed with what it reaches under {@link MapColorName}. Partial
11912
- * objects are fine; colours not given stay as they are.
11954
+ * Recolours the whole base map with up to ten semantic colours in one call — the style
11955
+ * themes' Foundations palette, each listed with what it reaches under {@link MapColorName}. Partial
11956
+ * objects are fine; colours not given stay as they are, except on the mono styles, which derive
11957
+ * the other nine from `land` as their theme does: there the theme's own formulas re-derive them
11958
+ * from the `land` given.
11913
11959
  *
11914
11960
  * @remarks
11915
11961
  * Each colour re-derives every shade the style built from it — a trunk variant, an outline, a
11916
11962
  * tunnel — at the style's own HSL offset, so those relationships survive the recolour. The ten
11917
- * are also the `colors.*` knobs, so `describe()`, `reset` and settings persistence apply.
11963
+ * are also the `colors.*` knobs, so `get`, `reset` and settings persistence apply.
11918
11964
  *
11919
11965
  * Those offsets come off the loaded style, which makes a palette a recolour and not an
11920
11966
  * inversion: dark land over `standardLight` pushes the derived shades to the ends of their
@@ -11927,6 +11973,7 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
11927
11973
  * ```typescript
11928
11974
  * styling.setMapColors({ land: '#f3f5f7', water: '#accbe2', roadMajor: '#a1b8ce', label: '#364659' });
11929
11975
  * styling.reset('colors.roadMajor'); // one colour back to the style
11976
+ * styling.setMapColors(deriveMapColors(['#0b2a3a', '#0fa8c8', '#f6efe3'])); // map-theme plugin assigns the roles
11930
11977
  * ```
11931
11978
  */
11932
11979
  setMapColors(colors: MapColors): void;
@@ -11959,17 +12006,21 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
11959
12006
  private refreshLayer;
11960
12007
  private refreshSpace;
11961
12008
  private defaultSpaceColor;
12009
+ private refreshMapColor;
12010
+ private derivedMapColorOf;
12011
+ private mapColorsOf;
11962
12012
  private refreshMapColorProperty;
11963
12013
  private refreshProjection;
11964
12014
  private refreshSky;
11965
12015
  private refreshVisibility;
12016
+ private baseMap;
12017
+ private liveBaseMapGroupVisibility;
11966
12018
  private refreshZoomBound;
11967
12019
  private styleZoomBound;
11968
12020
  private refreshZoomOffset;
11969
12021
  private refreshScaledProperty;
11970
12022
  private refreshColor;
11971
12023
  private setProperty;
11972
- private describeKnob;
11973
12024
  private defaultOf;
11974
12025
  private mapLevelDefaultOf;
11975
12026
  private assertKnob;
@@ -12031,6 +12082,10 @@ type TerrainSourcesWithLayers = {
12031
12082
  * elevation data of the map style.
12032
12083
  *
12033
12084
  * @remarks
12085
+ * **What this module owns:** whether the hillshade is shown, and whether and how high the surface is raised.
12086
+ * Shading method, light direction, strength, zoom range and colours are `hillshade.*` {@link StylingModule} knobs.
12087
+ * See [Who owns what](https://docs.tomtom.com/maps-sdk-js/guides/map/modules#who-owns-what).
12088
+ *
12034
12089
  * - **Hillshade** shades slopes on the flat map, so the relief reads at any pitch.
12035
12090
  * - **Elevation** raises the map surface in 3D, which a pitched camera shows. Combined with the
12036
12091
  * hillshade, a slope stays readable where the camera flattens it.
@@ -12310,7 +12365,7 @@ type AreaAnalyticsMetricConfig = {
12310
12365
  * @example
12311
12366
  * ```typescript
12312
12367
  * // Move all layers below the lowest label
12313
- * const config: TrafficAreaAnalyticsConfig = {
12368
+ * const config: TrafficAreaAnalyticsModuleConfig = {
12314
12369
  * beforeLayerConfig: {
12315
12370
  * heatmap: 'lowestLabel',
12316
12371
  * hexgrid: { flat2D: 'lowestLabel', extrusion3D: 'lowestPlaceLabel' },
@@ -12319,7 +12374,7 @@ type AreaAnalyticsMetricConfig = {
12319
12374
  * };
12320
12375
  *
12321
12376
  * // Only reposition the heatmap layer
12322
- * const config: TrafficAreaAnalyticsConfig = {
12377
+ * const config: TrafficAreaAnalyticsModuleConfig = {
12323
12378
  * beforeLayerConfig: { heatmap: 'top' },
12324
12379
  * };
12325
12380
  * ```
@@ -12403,7 +12458,7 @@ declare const TRAFFIC_LIGHT_COLORS: {
12403
12458
  readonly bad: "#e03030";
12404
12459
  };
12405
12460
  /**
12406
- * Default values for all {@link TrafficAreaAnalyticsConfig} options.
12461
+ * Default values for all {@link TrafficAreaAnalyticsModuleConfig} options.
12407
12462
  *
12408
12463
  * Use these as a reference for what the module applies when a property is omitted,
12409
12464
  * or spread them as a base when constructing a config programmatically.
@@ -12411,13 +12466,13 @@ declare const TRAFFIC_LIGHT_COLORS: {
12411
12466
  * @group Traffic Area Analytics
12412
12467
  */
12413
12468
  declare const AREA_ANALYTICS_DEFAULTS: {
12414
- /** @see {@link TrafficAreaAnalyticsConfig.visible} */
12469
+ /** @see {@link TrafficAreaAnalyticsModuleConfig.visible} */
12415
12470
  visible: true;
12416
- /** @see {@link TrafficAreaAnalyticsConfig.displayMode} */
12471
+ /** @see {@link TrafficAreaAnalyticsModuleConfig.displayMode} */
12417
12472
  displayMode: "hexgrid-3d";
12418
- /** @see {@link TrafficAreaAnalyticsConfig.activeMetric} */
12473
+ /** @see {@link TrafficAreaAnalyticsModuleConfig.activeMetric} */
12419
12474
  activeMetric: "congestionLevel";
12420
- /** @see {@link TrafficAreaAnalyticsConfig.metricConfig} */
12475
+ /** @see {@link TrafficAreaAnalyticsModuleConfig.metricConfig} */
12421
12476
  metricConfig: {
12422
12477
  congestionLevel: {
12423
12478
  color: {
@@ -12542,7 +12597,7 @@ declare const AREA_ANALYTICS_DEFAULTS: {
12542
12597
  *
12543
12598
  * @example
12544
12599
  * ```typescript
12545
- * const config: TrafficAreaAnalyticsConfig = {
12600
+ * const config: TrafficAreaAnalyticsModuleConfig = {
12546
12601
  * displayMode: 'hexgrid-3d',
12547
12602
  * activeMetric: 'congestionLevel',
12548
12603
  * metricConfig: {
@@ -12567,7 +12622,7 @@ declare const AREA_ANALYTICS_DEFAULTS: {
12567
12622
  *
12568
12623
  * @group Traffic Area Analytics
12569
12624
  */
12570
- type TrafficAreaAnalyticsConfig = MapModuleCommonConfig & {
12625
+ type TrafficAreaAnalyticsModuleConfig = MapModuleCommonConfig & {
12571
12626
  /**
12572
12627
  * Controls the visibility of the area analytics layers.
12573
12628
  *
@@ -12674,7 +12729,7 @@ type AreaAnalyticsSourcesWithLayers = {
12674
12729
  *
12675
12730
  * @group Traffic Area Analytics
12676
12731
  */
12677
- export declare class TrafficAreaAnalyticsModule extends AbstractDataOwnedMapModule<AreaAnalyticsSourcesWithLayers, TrafficAreaAnalyticsConfig> {
12732
+ export declare class TrafficAreaAnalyticsModule extends AbstractDataOwnedMapModule<AreaAnalyticsSourcesWithLayers, TrafficAreaAnalyticsModuleConfig> {
12678
12733
  private heatmapLayerSpec;
12679
12734
  private hexFillLayerSpec;
12680
12735
  private hexExtrusionLayerSpec;
@@ -12720,12 +12775,12 @@ export declare class TrafficAreaAnalyticsModule extends AbstractDataOwnedMapModu
12720
12775
  * });
12721
12776
  * ```
12722
12777
  */
12723
- static create(tomtomMap: TomTomMap, config?: TrafficAreaAnalyticsConfig): Promise<TrafficAreaAnalyticsModule>;
12778
+ static create(tomtomMap: TomTomMap, config?: TrafficAreaAnalyticsModuleConfig): Promise<TrafficAreaAnalyticsModule>;
12724
12779
  private constructor();
12725
12780
  /** @ignore */
12726
- protected _initSourcesWithLayers(config?: TrafficAreaAnalyticsConfig, _restore?: boolean): AreaAnalyticsSourcesWithLayers;
12781
+ protected _initSourcesWithLayers(config?: TrafficAreaAnalyticsModuleConfig, _restore?: boolean): AreaAnalyticsSourcesWithLayers;
12727
12782
  /** @ignore */
12728
- protected _applyConfig(config: TrafficAreaAnalyticsConfig | undefined): TrafficAreaAnalyticsConfig | undefined;
12783
+ protected _applyConfig(config: TrafficAreaAnalyticsModuleConfig | undefined): TrafficAreaAnalyticsModuleConfig | undefined;
12729
12784
  private moveLayersToSpecPositions;
12730
12785
  /** @ignore */
12731
12786
  protected discardShownData(): void;
@@ -12888,7 +12943,7 @@ export declare class TrafficAreaAnalyticsModule extends AbstractDataOwnedMapModu
12888
12943
  * });
12889
12944
  * ```
12890
12945
  */
12891
- get events(): CombinedEvents<AreaAnalyticsTileFeature, TrafficAreaAnalyticsConfig, TrafficAreaAnalytics>;
12946
+ get events(): CombinedEvents<AreaAnalyticsTileFeature, TrafficAreaAnalyticsModuleConfig, TrafficAreaAnalytics>;
12892
12947
  private get mode();
12893
12948
  private get activeMetric();
12894
12949
  private get lightDark();
@@ -13021,7 +13076,7 @@ export type TrafficCommonFilter = {
13021
13076
  * @example
13022
13077
  * ```ts
13023
13078
  * // Hide minor local streets
13024
- * roadSubCategories: { show: 'all_except', values: ['living_street'] }
13079
+ * roadSubCategories: { show: 'all-except', values: ['living_street'] }
13025
13080
  * ```
13026
13081
  */
13027
13082
  roadSubCategories?: ValuesFilter<RoadSubCategory>;
@@ -13093,7 +13148,7 @@ export type TrafficFlowFilters = {
13093
13148
  *
13094
13149
  * @group Traffic Flow
13095
13150
  */
13096
- export type FlowConfig = MapModuleCommonConfig & {
13151
+ export type TrafficFlowModuleConfig = MapModuleCommonConfig & {
13097
13152
  /**
13098
13153
  * Controls the visibility of the traffic flow layers.
13099
13154
  *
@@ -13115,6 +13170,12 @@ export type FlowConfig = MapModuleCommonConfig & {
13115
13170
  * Defines the structure of a traffic flow feature, which extends the basic GeoJSON feature
13116
13171
  * with properties extracted from the traffic flow vector tiles.
13117
13172
  *
13173
+ * @remarks
13174
+ * `absoluteSpeed`, `partOfTwoWayRoad` and `openlr` stay `undefined` with the standard styles, which do
13175
+ * not request their tile tags; a custom style whose flow source asks for them populates them.
13176
+ * No flow tile carries free-flow speed, travel time, delay or confidence: for historical speed and
13177
+ * congestion over an area, use the Traffic Area Analytics service.
13178
+ *
13118
13179
  * @group Traffic Flow
13119
13180
  */
13120
13181
  export type TrafficFlowModuleFeature = Feature<LineString, {
@@ -13170,6 +13231,10 @@ type TrafficFlowSourcesWithLayers = {
13170
13231
  * traffic speed conditions using color-coded road segments.
13171
13232
  *
13172
13233
  * @remarks
13234
+ * **What this module owns:** whether the style's traffic-flow layers are shown, and for which roads.
13235
+ * Each flow level's colour and the line width are `traffic.flow.*` knobs on {@link StylingModule}.
13236
+ * See [Who owns what](https://docs.tomtom.com/maps-sdk-js/guides/map/modules#who-owns-what).
13237
+ *
13173
13238
  * **Features:**
13174
13239
  * - Toggle traffic flow visibility on/off
13175
13240
  * - Filter by road categories and types
@@ -13215,7 +13280,7 @@ type TrafficFlowSourcesWithLayers = {
13215
13280
  * trafficFlow.filter({
13216
13281
  * any: [{
13217
13282
  * roadCategories: {
13218
- * show: 'all_except',
13283
+ * show: 'all-except',
13219
13284
  * values: ['street']
13220
13285
  * }
13221
13286
  * }]
@@ -13237,7 +13302,7 @@ type TrafficFlowSourcesWithLayers = {
13237
13302
  *
13238
13303
  * @group Traffic Flow
13239
13304
  */
13240
- export declare class TrafficFlowModule extends AbstractStyleOwnedMapModule<TrafficFlowSourcesWithLayers, FlowConfig> {
13305
+ export declare class TrafficFlowModule extends AbstractStyleOwnedMapModule<TrafficFlowSourcesWithLayers, TrafficFlowModuleConfig> {
13241
13306
  /**
13242
13307
  * Retrieves a TrafficFlowModule instance for the given map.
13243
13308
  *
@@ -13285,7 +13350,7 @@ export declare class TrafficFlowModule extends AbstractStyleOwnedMapModule<Traff
13285
13350
  * provides, under fixed global IDs. Every instance is another handle on that same shared state,
13286
13351
  * so visibility and filters applied through one are visible through all of them.
13287
13352
  */
13288
- static get(map: TomTomMap, config?: FlowConfig): Promise<TrafficFlowModule>;
13353
+ static get(map: TomTomMap, config?: TrafficFlowModuleConfig): Promise<TrafficFlowModule>;
13289
13354
  private constructor();
13290
13355
  /**
13291
13356
  * @ignore
@@ -13296,7 +13361,7 @@ export declare class TrafficFlowModule extends AbstractStyleOwnedMapModule<Traff
13296
13361
  /**
13297
13362
  * @ignore
13298
13363
  */
13299
- protected _applyConfig(config: FlowConfig | undefined): FlowConfig | undefined;
13364
+ protected _applyConfig(config: TrafficFlowModuleConfig | undefined): TrafficFlowModuleConfig | undefined;
13300
13365
  private getLayers;
13301
13366
  /**
13302
13367
  * Applies filters to traffic flow display.
@@ -13340,7 +13405,7 @@ export declare class TrafficFlowModule extends AbstractStyleOwnedMapModule<Traff
13340
13405
  * trafficFlow.filter({
13341
13406
  * any: [{
13342
13407
  * roadCategories: {
13343
- * show: 'all_except',
13408
+ * show: 'all-except',
13344
13409
  * values: ['street']
13345
13410
  * }
13346
13411
  * }]
@@ -13393,16 +13458,9 @@ export declare class TrafficFlowModule extends AbstractStyleOwnedMapModule<Traff
13393
13458
  * @returns An object containing visible traffic flow features.
13394
13459
  *
13395
13460
  * @remarks
13396
- * Returns all traffic flow features currently rendered in the visible map area.
13397
- * These represent road segments with real-time traffic speed information.
13398
- *
13399
- * **Feature Properties:**
13400
- * Properties depend on the traffic flow vector tile schema and may include:
13401
- * - Current speed
13402
- * - Free flow speed
13403
- * - Road category
13404
- * - Congestion level
13405
- * - Road closure status
13461
+ * The only way to read live flow values: Orbis traffic flow is vector tiles, with no service for a
13462
+ * road, a point or an area. Results cover the current viewport and zoom, and a segment crossing a
13463
+ * tile boundary appears once per tile. See {@link TrafficFlowModuleFeature} for what each carries.
13406
13464
  *
13407
13465
  * @example
13408
13466
  * ```typescript
@@ -13418,7 +13476,7 @@ export declare class TrafficFlowModule extends AbstractStyleOwnedMapModule<Traff
13418
13476
  * ```typescript
13419
13477
  * const shown = trafficFlow.getShown();
13420
13478
  * const congested = shown.trafficFlow.filter(
13421
- * segment => segment.properties.speed < segment.properties.freeFlowSpeed * 0.5
13479
+ * segment => segment.properties.relativeSpeed < 0.5
13422
13480
  * );
13423
13481
  * console.log(`Congested segments: ${congested.length}`);
13424
13482
  * ```
@@ -13426,7 +13484,7 @@ export declare class TrafficFlowModule extends AbstractStyleOwnedMapModule<Traff
13426
13484
  getShown(): {
13427
13485
  trafficFlow: TrafficFlowModuleFeature[];
13428
13486
  };
13429
- get events(): CombinedEvents<TrafficFlowModuleFeature, FlowConfig, never>;
13487
+ get events(): CombinedEvents<TrafficFlowModuleFeature, TrafficFlowModuleConfig, never>;
13430
13488
  }
13431
13489
  //#endregion
13432
13490
  //#region src/traffic/types/trafficIncidentOverlayConfig.d.ts
@@ -13454,7 +13512,7 @@ type IncidentFocusStyle = {
13454
13512
  *
13455
13513
  * @group Traffic
13456
13514
  */
13457
- type TrafficIncidentOverlayConfig = MapModuleCommonConfig & {
13515
+ type TrafficIncidentOverlayModuleConfig = MapModuleCommonConfig & {
13458
13516
  /**
13459
13517
  * Initial visibility of all incident layers. Defaults to `true`.
13460
13518
  * `show()` never flips this flag — if `false`, the module loads data but
@@ -13580,7 +13638,7 @@ type Sources = {
13580
13638
  *
13581
13639
  * @group Traffic
13582
13640
  */
13583
- export declare class TrafficIncidentOverlayModule extends AbstractDataOwnedMapModule<Sources, TrafficIncidentOverlayConfig> {
13641
+ export declare class TrafficIncidentOverlayModule extends AbstractDataOwnedMapModule<Sources, TrafficIncidentOverlayModuleConfig> {
13584
13642
  private lastResult;
13585
13643
  private lastFeatureIds;
13586
13644
  private lastFocusIds;
@@ -13596,12 +13654,12 @@ export declare class TrafficIncidentOverlayModule extends AbstractDataOwnedMapMo
13596
13654
  * @param config The module optional configuration.
13597
13655
  * @returns {Promise} Returns a promise with a new instance of this module.
13598
13656
  */
13599
- static create(tomtomMap: TomTomMap, config?: TrafficIncidentOverlayConfig): Promise<TrafficIncidentOverlayModule>;
13657
+ static create(tomtomMap: TomTomMap, config?: TrafficIncidentOverlayModuleConfig): Promise<TrafficIncidentOverlayModule>;
13600
13658
  private constructor();
13601
13659
  /** @ignore */
13602
- protected _initSourcesWithLayers(config?: TrafficIncidentOverlayConfig, _restore?: boolean): Sources;
13660
+ protected _initSourcesWithLayers(config?: TrafficIncidentOverlayModuleConfig, _restore?: boolean): Sources;
13603
13661
  /** @ignore */
13604
- protected _applyConfig(config: TrafficIncidentOverlayConfig | undefined): TrafficIncidentOverlayConfig | undefined;
13662
+ protected _applyConfig(config: TrafficIncidentOverlayModuleConfig | undefined): TrafficIncidentOverlayModuleConfig | undefined;
13605
13663
  private applyBeforeLayer;
13606
13664
  /** @ignore */
13607
13665
  protected discardShownData(): void;
@@ -13639,7 +13697,7 @@ export declare class TrafficIncidentOverlayModule extends AbstractDataOwnedMapMo
13639
13697
  getShown(): {
13640
13698
  incidents: TrafficIncidentDetails;
13641
13699
  };
13642
- get events(): CombinedEvents<TrafficIncident, TrafficIncidentOverlayConfig, TrafficIncidentDetails>;
13700
+ get events(): CombinedEvents<TrafficIncident, TrafficIncidentOverlayModuleConfig, TrafficIncidentDetails>;
13643
13701
  /**
13644
13702
  * Mark a subset of currently-rendered incidents as "focused" via MapLibre
13645
13703
  * feature-state. `null` clears the state. Paint expressions in
@@ -13737,7 +13795,7 @@ export type TrafficIncidentsFilter = TrafficCommonFilter & {
13737
13795
  * magnitudes: { show: 'only', values: ['moderate', 'major'] }
13738
13796
  *
13739
13797
  * // Hide minor incidents
13740
- * magnitudes: { show: 'all_except', values: ['minor'] }
13798
+ * magnitudes: { show: 'all-except', values: ['minor'] }
13741
13799
  * ```
13742
13800
  */
13743
13801
  magnitudes?: ValuesFilter<DelayMagnitude>;
@@ -13814,7 +13872,7 @@ export type IncidentsCommonConfig = {
13814
13872
  *
13815
13873
  * @group Traffic Incidents
13816
13874
  */
13817
- export type IncidentsConfig = MapModuleCommonConfig & IncidentsCommonConfig & {
13875
+ export type TrafficIncidentsModuleConfig = MapModuleCommonConfig & IncidentsCommonConfig & {
13818
13876
  /**
13819
13877
  * Configuration specific to incident icon display.
13820
13878
  *
@@ -13882,6 +13940,10 @@ type TrafficIncidentsSourcesWithLayers = {
13882
13940
  * events like accidents, road closures, construction, and hazards.
13883
13941
  *
13884
13942
  * @remarks
13943
+ * **What this module owns:** whether the style's incident layers are shown, and which incidents.
13944
+ * Each magnitude's colour and the line width are `traffic.incidents.*` knobs on {@link StylingModule}.
13945
+ * See [Who owns what](https://docs.tomtom.com/maps-sdk-js/guides/map/modules#who-owns-what).
13946
+ *
13885
13947
  * **Features:**
13886
13948
  * - Toggle incidents visibility on/off
13887
13949
  * - Separate control for incident icons
@@ -13934,7 +13996,7 @@ type TrafficIncidentsSourcesWithLayers = {
13934
13996
  * trafficIncidentsModule.filter({
13935
13997
  * any: [{
13936
13998
  * incidentCategories: {
13937
- * show: 'all_except',
13999
+ * show: 'all-except',
13938
14000
  * values: ['roadworks']
13939
14001
  * }
13940
14002
  * }]
@@ -13990,7 +14052,7 @@ type TrafficIncidentsSourcesWithLayers = {
13990
14052
  *
13991
14053
  * @group Traffic Incidents
13992
14054
  */
13993
- export declare class TrafficIncidentsModule extends AbstractStyleOwnedMapModule<TrafficIncidentsSourcesWithLayers, IncidentsConfig> {
14055
+ export declare class TrafficIncidentsModule extends AbstractStyleOwnedMapModule<TrafficIncidentsSourcesWithLayers, TrafficIncidentsModuleConfig> {
13994
14056
  /**
13995
14057
  * Retrieves a TrafficIncidentsModule instance for the given map.
13996
14058
  *
@@ -14038,7 +14100,7 @@ export declare class TrafficIncidentsModule extends AbstractStyleOwnedMapModule<
14038
14100
  * provides, under fixed global IDs. Every instance is another handle on that same shared state,
14039
14101
  * so visibility and filters applied through one are visible through all of them.
14040
14102
  */
14041
- static get(map: TomTomMap, config?: IncidentsConfig): Promise<TrafficIncidentsModule>;
14103
+ static get(map: TomTomMap, config?: TrafficIncidentsModuleConfig): Promise<TrafficIncidentsModule>;
14042
14104
  private constructor();
14043
14105
  /**
14044
14106
  * @ignore
@@ -14049,7 +14111,7 @@ export declare class TrafficIncidentsModule extends AbstractStyleOwnedMapModule<
14049
14111
  /**
14050
14112
  * @ignore
14051
14113
  */
14052
- protected _applyConfig(config: IncidentsConfig | undefined): IncidentsConfig | undefined;
14114
+ protected _applyConfig(config: TrafficIncidentsModuleConfig | undefined): TrafficIncidentsModuleConfig | undefined;
14053
14115
  /**
14054
14116
  * Applies filters to traffic incidents display.
14055
14117
  *
@@ -14231,7 +14293,7 @@ export declare class TrafficIncidentsModule extends AbstractStyleOwnedMapModule<
14231
14293
  getShown(): {
14232
14294
  trafficIncidents: TrafficIncidentsModuleFeature[];
14233
14295
  };
14234
- get events(): CombinedEvents<TrafficIncidentsModuleFeature, IncidentsConfig, never>;
14296
+ get events(): CombinedEvents<TrafficIncidentsModuleFeature, TrafficIncidentsModuleConfig, never>;
14235
14297
  }
14236
14298
  //#endregion
14237
14299
  //#region src/utils/colorUtils.d.ts
@@ -14241,12 +14303,34 @@ export declare class TrafficIncidentsModule extends AbstractStyleOwnedMapModule<
14241
14303
  */
14242
14304
  type RGBAColor = [number, number, number, number];
14243
14305
  /**
14244
- * Parses any CSS colour a map style writes — `#rgb`, `#rrggbb(aa)`, `rgb()`/`rgba()` in numbers or
14245
- * percentages, `hsl()`/`hsla()`, `transparent` and the named colours — or `undefined` for a string
14246
- * that is not one.
14306
+ * {@link parseColor} as an {@link RGBAColor} tuple.
14247
14307
  * @ignore
14248
14308
  */
14249
14309
  export declare const parseCssColor: (cssColor: string) => RGBAColor | undefined;
14310
+ /**
14311
+ * A colour in HSL: hue in degrees (none for a grey), saturation, lightness and alpha 0–1 — the shape
14312
+ * of culori's `Hsl`, so culori's functions take it.
14313
+ * @ignore
14314
+ */
14315
+ type HslColor = {
14316
+ mode: 'hsl';
14317
+ h?: number;
14318
+ s: number;
14319
+ l: number;
14320
+ alpha?: number;
14321
+ };
14322
+ /**
14323
+ * The HSL of a CSS colour, or `undefined` when it cannot be parsed. Read through sRGB, so an
14324
+ * `hsl()` literal comes back canonical — white has no saturation, a grey no hue.
14325
+ * @ignore
14326
+ */
14327
+ export declare const toHsl: (cssColor: string) => HslColor | undefined;
14328
+ /**
14329
+ * Formats an HSL colour as a CSS `hsl()`/`hsla()` string, rounded to what the map styles themselves
14330
+ * use: whole degrees and percents.
14331
+ * @ignore
14332
+ */
14333
+ export declare const formatStyleHsl: (hsl: Omit<HslColor, "mode">) => string;
14250
14334
  //#endregion
14251
14335
  //#region src/utils/types/paddedBounds.d.ts
14252
14336
  /**
@@ -14328,4 +14412,4 @@ export declare const calculatePaddedCenter: (options: CalculateMapCenterOptions)
14328
14412
  */
14329
14413
  export declare const calculateFittingBBox: (options: CalculateFittingBBoxOptions) => BBox | null;
14330
14414
  //#endregion
14331
- export type { AREA_ANALYTICS_DEFAULTS, AreaAnalyticsBeforeLayerConfig, AreaAnalyticsColorStop, AreaAnalyticsColorStopsConfig, AreaAnalyticsColorTheme, AreaAnalyticsDisplayMode, AreaAnalyticsHeightConfig, AreaAnalyticsMetricConfig, AreaAnalyticsMetricFilter, AreaAnalyticsRegionPolygonConfig, AreaAnalyticsValueType, AvailabilityLevel, BeforeLayerConfig, BespokeSectionType, ByIdOrIndex, CSSCursor, ChargingSpeedIconMapping, ChargingStopIconConfig, ChargingStopIconMapping, ChargingStopTextConfig, ChargingStopsConfig, CleanEventStateOptions, CleanEventStatesOptions, ClickEventType, CountryCrossingAlignment, CountryCrossingConfig, CountryCrossingFeature, CustomImage, DefaultPlaceIconConfig, DisplayCountryCrossing, DisplayCountryCrossingProps, DisplayCountryCrossings, DisplayRouteProps, DisplayRouteRelatedProps, DisplayRouteSummaries, DisplayRouteSummary, DisplayRouteSummaryProps, DrawnSectionType, EVAvailabilityConfig, EventHandlerConfig, EventHandlerCursorConfig, EventType, ExtraFeatureProp, FeaturePropValue, FilterShowMode, FilterablePOICategory, GeneratedSectionType, GeoJSONSourcesWithLayers, HasAdditionalLayersConfig, HasBeforeID, HoverEventType, IncidentFocusStyle, LayerQuery, LayerSpecFilter, LayerSpecTemplate, LayerSpecWithSource, LightDark, MapColorName, MapColors, MapEventsConfig, MapFont, MapModuleCommonConfig, MapStyleLayerID, POIsModuleConfig, POIsModuleFeature, PlaceConnectionDisplay, PlaceConnectionLayerName, PlaceConnectionsConfig, PlaceConnectionsLayersConfig, PlaceIconConfig, PlaceLayerName, PlaceLayersConfig, PlaceTextConfig, PlacesModuleConfig, PlacesTheme, PlanningWaypoint, PutEventStateOptions, RGBAColor, RouteLayersConfig, RouteStateProps, RouteTheme, RouteWaypointSize, RouteWidth, RoutingModuleConfig, SVGIconStyleOptions, SectionDisplayConfig, SectionDrawStyle, SectionIconConfig, SectionKnobName, SectionKnobOf, SectionLineLayerName, SectionLinePattern, SectionSignConfig, SectionSignLayerName, SectionSignPlacement, SectionSignPriority, SectionSignUnit, SectionSourceKey, SectionSymbolLayerName, SectionsDisplayConfig, SourceWithLayerIDs, SourceWithLayers, SourcesWithLayers, StyleSourcesWithLayers, StylingCatalogue, StylingColorKnobId, StylingKnobAppliesTo, StylingKnobDescriptor, StylingKnobId, StylingKnobKind, StylingKnobRange, StylingKnobValue, StylingKnobValueOf, StylingPresetDescriptor, StylingPresetId, StylingSettings, SupportsEvents, SymbolLayerSpecWithoutSource, TRAFFIC_LIGHT_COLORS, TerrainModuleConfig, ToBeAddedLayerSpec, ToBeAddedLayerSpecTemplate, ToBeAddedLayerSpecWithoutSource, TrafficAreaAnalyticsConfig, TrafficIncidentOverlayConfig, UserEventHandler, ValuesFilter, WaypointsConfig };
14415
+ export type { AREA_ANALYTICS_DEFAULTS, AreaAnalyticsBeforeLayerConfig, AreaAnalyticsColorStop, AreaAnalyticsColorStopsConfig, AreaAnalyticsColorTheme, AreaAnalyticsDisplayMode, AreaAnalyticsHeightConfig, AreaAnalyticsMetricConfig, AreaAnalyticsMetricFilter, AreaAnalyticsRegionPolygonConfig, AreaAnalyticsValueType, AvailabilityLevel, BeforeLayerConfig, BespokeSectionType, ByIdOrIndex, CSSCursor, ChargingSpeedIconMapping, ChargingStopIconConfig, ChargingStopIconMapping, ChargingStopTextConfig, ChargingStopsConfig, CleanEventStateOptions, CleanEventStatesOptions, ClickEventType, CountryCrossingAlignment, CountryCrossingConfig, CountryCrossingFeature, CustomImage, DefaultPlaceIconConfig, DisplayCountryCrossing, DisplayCountryCrossingProps, DisplayCountryCrossings, DisplayRouteProps, DisplayRouteRelatedProps, DisplayRouteSummaries, DisplayRouteSummary, DisplayRouteSummaryProps, DrawnSectionType, EVAvailabilityConfig, EventHandlerConfig, EventHandlerCursorConfig, EventHandlerHoverConfig, EventState, EventType, ExtraFeatureProp, FeaturePropValue, FilterablePOICategory, GeneratedSectionType, GeoJSONSourcesWithLayers, HasAdditionalLayersConfig, HasBeforeID, HoverEventType, HslColor, IncidentFocusStyle, LayerQuery, LayerSpecFilter, LayerSpecTemplate, LayerSpecWithSource, LightDark, MapColorName, MapColors, MapEventsConfig, MapFont, MapModuleCommonConfig, MapStyleLayerID, POIsModuleConfig, POIsModuleFeature, PlaceConnectionDisplay, PlaceConnectionLayerName, PlaceConnectionsConfig, PlaceConnectionsLayersConfig, PlaceEntryPointFeature, PlaceEntryPointProps, PlaceEntryPointsConfig, PlaceEntryPointsLayersConfig, PlaceEntryPointsShowFor, PlaceIconConfig, PlaceLayerName, PlaceLayersConfig, PlaceTextConfig, PlacesModuleConfig, PlacesTheme, PlanningWaypoint, PutEventStateOptions, RGBAColor, RouteLayersConfig, RouteStateProps, RouteTheme, RouteWaypointSize, RouteWidth, RoutingModuleConfig, SVGIconStyleOptions, SectionDisplayConfig, SectionDrawStyle, SectionIconConfig, SectionKnobName, SectionKnobOf, SectionLineLayerName, SectionLinePattern, SectionSignConfig, SectionSignLayerName, SectionSignPlacement, SectionSignPriority, SectionSignUnit, SectionSourceKey, SectionSymbolLayerName, SectionsDisplayConfig, SourceWithLayerIDs, SourceWithLayers, SourcesWithLayers, StyleSourcesWithLayers, StylingColorKnobId, StylingKnob, StylingKnobAppliesTo, StylingKnobId, StylingKnobKind, StylingKnobRange, StylingKnobValue, StylingKnobValueOf, StylingPreset, StylingPresetId, StylingSettings, SupportsEvents, SymbolLayerSpecWithoutSource, TRAFFIC_LIGHT_COLORS, TerrainModuleConfig, ToBeAddedLayerSpec, ToBeAddedLayerSpecTemplate, ToBeAddedLayerSpecWithoutSource, TrafficAreaAnalyticsModuleConfig, TrafficIncidentOverlayModuleConfig, UserEventHandler, WaypointsConfig };