@tomtom-org/maps-sdk 0.45.6 → 0.45.8

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.
@@ -35,7 +35,9 @@ import { Places } from '@tomtom-org/maps-sdk/core';
35
35
  import { Places as Places_2 } from '@tomtom-org/maps-sdk/core';
36
36
  import { POICategory } from '@tomtom-org/maps-sdk/core';
37
37
  import { Point } from 'geojson';
38
+ import { PolygonFeature } from '@tomtom-org/maps-sdk/core';
38
39
  import { PolygonFeatures } from '@tomtom-org/maps-sdk/core';
40
+ import { PolygonFeatures as PolygonFeatures_2 } from '@tomtom-org/maps-sdk/core';
39
41
  import { Position } from 'geojson';
40
42
  import { Route } from '@tomtom-org/maps-sdk/core';
41
43
  import { RouteProps } from '@tomtom-org/maps-sdk/core';
@@ -46,6 +48,7 @@ import { Source } from 'maplibre-gl';
46
48
  import { SourceSpecification } from 'maplibre-gl';
47
49
  import { StyleSpecification } from 'maplibre-gl';
48
50
  import { SymbolLayerSpecification } from 'maplibre-gl';
51
+ import { TrafficIncidentCategory } from '@tomtom-org/maps-sdk/core';
49
52
  import { TrafficSectionProps } from '@tomtom-org/maps-sdk/core';
50
53
  import { Waypoint } from '@tomtom-org/maps-sdk/core';
51
54
  import { WaypointLike } from '@tomtom-org/maps-sdk/core';
@@ -965,6 +968,31 @@ declare type BaseSourceAndLayers = {
965
968
  */
966
969
  export declare const buildPlaceTitle: (place: Place) => string;
967
970
 
971
+ /**
972
+ * Attaches labels and applies theme-specific geometry to reachable range polygon features.
973
+ *
974
+ * Features must be ordered **largest budget first** (e.g. 30 min, 20 min, 10 min).
975
+ * For the `inverted` theme, polygons are converted to donuts and one extra innermost feature is appended.
976
+ *
977
+ * @param features Polygon features from `calculateReachableRange`, ordered largest budget first.
978
+ * @param labels Label per feature in matching order (e.g. `['30 min', '20 min', '10 min']`).
979
+ * @param theme Visual theme. Defaults to `'filled'`.
980
+ *
981
+ * @example
982
+ * ```typescript
983
+ * const features = [range30min, range20min, range10min];
984
+ * const labels = ['30 min', '20 min', '10 min'];
985
+ *
986
+ * module.show({
987
+ * type: 'FeatureCollection',
988
+ * features: buildReachableRangeFeatures(features, labels, 'inverted'),
989
+ * });
990
+ * ```
991
+ *
992
+ * @group Geometries
993
+ */
994
+ export declare const buildReachableRangeFeatures: (features: PolygonFeature[], labels: string[], theme?: GeometryTheme) => PolygonFeature[];
995
+
968
996
  /**
969
997
  * Generates the routing layers configuration for route visualization on the map.
970
998
  * @param config - Optional routing module configuration to customize layer properties.
@@ -1301,9 +1329,11 @@ export declare type CleanEventStatesOptions = {
1301
1329
  */
1302
1330
  export declare type ClickEventType = 'click' | 'contextmenu';
1303
1331
 
1304
- declare type ColorPaletteOptions = keyof typeof colorPalettes;
1332
+ export declare const colorPaletteIDs: ColorPaletteOptions[];
1305
1333
 
1306
- declare const colorPalettes: {
1334
+ export declare type ColorPaletteOptions = keyof typeof colorPalettes;
1335
+
1336
+ export declare const colorPalettes: {
1307
1337
  warm: string[];
1308
1338
  browns: string[];
1309
1339
  cold: string[];
@@ -1585,7 +1615,7 @@ export declare const defaultRoutingLayers: Required<RouteLayersConfig>;
1585
1615
  * Allows filtering incidents based on whether they cause delays and the severity of those delays.
1586
1616
  * Useful for focusing on incidents with the most significant traffic impact.
1587
1617
  *
1588
- * @group Traffic
1618
+ * @group Traffic Incidents
1589
1619
  */
1590
1620
  export declare type DelayFilter = {
1591
1621
  /**
@@ -2265,7 +2295,27 @@ export declare class EventsModule<T = MapGeoJSONFeature> {
2265
2295
  private readonly eventProxy;
2266
2296
  private readonly sourceWithLayers;
2267
2297
  private readonly config;
2268
- constructor(eventProxy: EventsProxy, sourceWithLayers: SourceWithLayers, config: EventHandlerConfig | undefined);
2298
+ /**
2299
+ * Optional function that transforms a raw {@link MapGeoJSONFeature} into the
2300
+ * feature type `T` exposed by the module. When provided, every feature passed (fired)
2301
+ * to event handlers is first run through this function, so callers receive the
2302
+ * module's own feature shape instead of the underlying MapLibre feature.
2303
+ *
2304
+ * When omitted, `T` defaults to `MapGeoJSONFeature` and features are forwarded
2305
+ * as-is.
2306
+ */
2307
+ private readonly mapping?;
2308
+ constructor(eventProxy: EventsProxy, sourceWithLayers: SourceWithLayers, config: EventHandlerConfig | undefined,
2309
+ /**
2310
+ * Optional function that transforms a raw {@link MapGeoJSONFeature} into the
2311
+ * feature type `T` exposed by the module. When provided, every feature passed (fired)
2312
+ * to event handlers is first run through this function, so callers receive the
2313
+ * module's own feature shape instead of the underlying MapLibre feature.
2314
+ *
2315
+ * When omitted, `T` defaults to `MapGeoJSONFeature` and features are forwarded
2316
+ * as-is.
2317
+ */
2318
+ mapping?: ((feature: MapGeoJSONFeature) => T) | undefined);
2269
2319
  /**
2270
2320
  * Register an event handler for user interactions with map features.
2271
2321
  *
@@ -2764,11 +2814,14 @@ export declare class GeometriesModule extends AbstractMapModule<GeometrySourcesW
2764
2814
  private titleLayerSpecs;
2765
2815
  private geometryFillLayerSpecs;
2766
2816
  private geometryOutlineLayerSpecs;
2817
+ private lineLabelLayerSpecs;
2767
2818
  private sourceID;
2768
2819
  private fillLayerID;
2769
2820
  private outlineLayerID;
2821
+ private lineLabelLayerID;
2770
2822
  private titleSourceID;
2771
2823
  private titleLayerID;
2824
+ private lastRawInput;
2772
2825
  /**
2773
2826
  * Make sure the map is ready before create an instance of the module and any other interaction with the map
2774
2827
  * @param tomtomMap The TomTomMap instance.
@@ -3142,18 +3195,61 @@ export declare type GeometriesModuleConfig = MapModuleCommonConfig & {
3142
3195
  * ```
3143
3196
  */
3144
3197
  beforeLayerConfig?: GeometryBeforeLayerConfig;
3198
+ /**
3199
+ * Line label configuration.
3200
+ *
3201
+ * When set, labels are placed along the polygon border lines.
3202
+ */
3203
+ lineLabelConfig?: GeometryLineLabelConfig;
3204
+ /**
3205
+ * Visual theme applied to all features shown by this module.
3206
+ *
3207
+ * - `'filled'` — Colored fill with thin border (default)
3208
+ * - `'outline'` — Transparent fill with thick colored border
3209
+ * - `'inverted'` — Colors the area **outside** the polygon (donut geometry)
3210
+ *
3211
+ * Individual features can override this by setting `theme` in their properties.
3212
+ *
3213
+ * @example
3214
+ * ```typescript
3215
+ * // Show the "rest of the world" outside a country
3216
+ * const module = await GeometriesModule.get(map, {
3217
+ * theme: 'inverted',
3218
+ * colorConfig: { fillColor: 'black', fillOpacity: 0.5 }
3219
+ * });
3220
+ * module.show(countryGeometry);
3221
+ * ```
3222
+ */
3223
+ theme?: GeometryTheme;
3224
+ /**
3225
+ * Transform applied to features before rendering.
3226
+ *
3227
+ * Receives the value passed to {@link GeometriesModule.show} and returns
3228
+ * features ready for display. Useful for deriving labels or other display
3229
+ * properties from domain data.
3230
+ *
3231
+ * @remarks
3232
+ * Used internally by {@link reachableRangeGeometryConfig} to generate budget
3233
+ * labels (e.g. `'30 min'`) from feature properties. For most use cases,
3234
+ * the standard config fields (`colorConfig`, `textConfig`, `theme`) suffice.
3235
+ *
3236
+ * @example
3237
+ * ```typescript
3238
+ * // Derive title from a custom property
3239
+ * const config: GeometriesModuleConfig = {
3240
+ * transformFeaturesForDisplay: (fc) => ({
3241
+ * ...fc,
3242
+ * features: fc.features.map((f) => ({
3243
+ * ...f,
3244
+ * properties: { ...f.properties, title: f.properties?.customLabel },
3245
+ * })),
3246
+ * }),
3247
+ * };
3248
+ * ```
3249
+ */
3250
+ transformFeaturesForDisplay?: (input: PolygonFeatures_2) => PolygonFeatures_2;
3145
3251
  };
3146
3252
 
3147
- /**
3148
- * @ignore
3149
- */
3150
- export declare const GEOMETRY_COLOR_PROP = "color";
3151
-
3152
- /**
3153
- * @ignore
3154
- */
3155
- export declare const GEOMETRY_TITLE_PROP = "title";
3156
-
3157
3253
  /**
3158
3254
  * Layer positioning configuration for geometries.
3159
3255
  *
@@ -3214,7 +3310,7 @@ export declare type GeometryColorConfig = {
3214
3310
  * - Color palette name (e.g., `'red'`, `'blue'`)
3215
3311
  * - MapLibre expression for data-driven styling
3216
3312
  *
3217
- * @default '#0080FF'
3313
+ * @default '#0A3653'
3218
3314
  *
3219
3315
  * @example
3220
3316
  * ```typescript
@@ -3238,7 +3334,7 @@ export declare type GeometryColorConfig = {
3238
3334
  * @remarks
3239
3335
  * Value between 0 (fully transparent) and 1 (fully opaque).
3240
3336
  *
3241
- * @default 0.3
3337
+ * @default 0.15
3242
3338
  *
3243
3339
  * @example
3244
3340
  * ```typescript
@@ -3279,7 +3375,7 @@ export declare type GeometryLineConfig = {
3279
3375
  /**
3280
3376
  * Color of the geometry border/outline.
3281
3377
  *
3282
- * @default '#0080FF'
3378
+ * @default '#0A3653'
3283
3379
  *
3284
3380
  * @example
3285
3381
  * ```typescript
@@ -3318,6 +3414,97 @@ export declare type GeometryLineConfig = {
3318
3414
  lineWidth?: DataDrivenPropertyValueSpecification<number>;
3319
3415
  };
3320
3416
 
3417
+ /**
3418
+ * Line label configuration for geometries.
3419
+ *
3420
+ * When set, a symbol layer is added to the geometry source,
3421
+ * placing labels along the polygon border lines
3422
+ *
3423
+ * @example
3424
+ * ```typescript
3425
+ * // Defaults
3426
+ * const lineLabelConfig: GeometryLineLabelConfig = {};
3427
+ *
3428
+ * // Custom appearance for dark fills
3429
+ * const lineLabelConfig: GeometryLineLabelConfig = {
3430
+ * minZoom: 10,
3431
+ * textColor: '#FFFFFF',
3432
+ * textHaloColor: '#000000',
3433
+ * textSize: 13
3434
+ * };
3435
+ * ```
3436
+ *
3437
+ * @group Geometries
3438
+ */
3439
+ export declare type GeometryLineLabelConfig = {
3440
+ /**
3441
+ * Minimum zoom level at which border labels are visible.
3442
+ *
3443
+ * @default 3
3444
+ */
3445
+ minZoom?: number;
3446
+ /**
3447
+ * Font size of the border labels in pixels.
3448
+ *
3449
+ * @default 15
3450
+ *
3451
+ * @example
3452
+ * ```typescript
3453
+ * textSize: 13
3454
+ * // Data-driven
3455
+ * textSize: ['interpolate', ['linear'], ['zoom'], 8, 12, 14, 16]
3456
+ * ```
3457
+ */
3458
+ textSize?: DataDrivenPropertyValueSpecification<number>;
3459
+ /**
3460
+ * Color of the border label text.
3461
+ *
3462
+ * @default '#333333'
3463
+ *
3464
+ * @example
3465
+ * ```typescript
3466
+ * textColor: '#FFFFFF'
3467
+ * textColor: ['get', 'labelColor']
3468
+ * ```
3469
+ */
3470
+ textColor?: DataDrivenPropertyValueSpecification<string>;
3471
+ /**
3472
+ * Color of the halo drawn around the border label text.
3473
+ *
3474
+ * The halo improves legibility against complex or dark backgrounds.
3475
+ *
3476
+ * @default '#FFFFFF'
3477
+ *
3478
+ * @example
3479
+ * ```typescript
3480
+ * textHaloColor: '#000000'
3481
+ * ```
3482
+ */
3483
+ textHaloColor?: DataDrivenPropertyValueSpecification<string>;
3484
+ /**
3485
+ * Width of the halo drawn around the border label text, in pixels.
3486
+ *
3487
+ * @default 2
3488
+ *
3489
+ * @example
3490
+ * ```typescript
3491
+ * textHaloWidth: 3
3492
+ * ```
3493
+ */
3494
+ textHaloWidth?: DataDrivenPropertyValueSpecification<number>;
3495
+ /**
3496
+ * Distance between repeated labels along the border line, in pixels.
3497
+ *
3498
+ * @default 200
3499
+ *
3500
+ * @example
3501
+ * ```typescript
3502
+ * symbolSpacing: 350
3503
+ * ```
3504
+ */
3505
+ symbolSpacing?: number;
3506
+ };
3507
+
3321
3508
  /**
3322
3509
  * IDs of sources and layers from a geometry module.
3323
3510
  */
@@ -3369,6 +3556,27 @@ export declare type GeometryTextConfig = {
3369
3556
  textField: DataDrivenPropertyValueSpecification<string>;
3370
3557
  };
3371
3558
 
3559
+ /**
3560
+ * Visual theme for polygon display with {@link GeometriesModule}.
3561
+ *
3562
+ * - `'filled'` — Colored fill with thin border (default)
3563
+ * - `'outline'` — Transparent fill with thick colored border
3564
+ * - `'inverted'` — Colors the area **outside** the polygon (donut geometry)
3565
+ *
3566
+ * Set via {@link GeometriesModuleConfig.theme} at config level, or per-feature in
3567
+ * `properties.theme`.
3568
+ *
3569
+ * @group Geometries
3570
+ */
3571
+ export declare type GeometryTheme = 'filled' | 'outline' | 'inverted';
3572
+
3573
+ /**
3574
+ * All valid {@link GeometryTheme} values.
3575
+ *
3576
+ * @group Geometries
3577
+ */
3578
+ export declare const geometryThemes: readonly ["filled", "outline", "inverted"];
3579
+
3372
3580
  /**
3373
3581
  * Gets the map style sprite image ID to display on the map for the give place.
3374
3582
  * @ignore
@@ -3650,47 +3858,6 @@ declare type HillshadeSourcesWithLayers = {
3650
3858
  */
3651
3859
  export declare type HoverEventType = 'hover' | 'hover-move' | 'long-hover';
3652
3860
 
3653
- /**
3654
- * Available traffic incident category identifiers.
3655
- *
3656
- * @remarks
3657
- * These categories classify different types of traffic incidents that can be displayed on the map.
3658
- *
3659
- * @group Traffic Incidents
3660
- */
3661
- export declare const incidentCategories: readonly ["unknown", "accident", "fog", "dangerous_conditions", "rain", "ice", "jam", "lane_closed", "road_closed", "road_works", "wind", "flooding", "broken_down_vehicle"];
3662
-
3663
- /**
3664
- * @ignore
3665
- */
3666
- export declare const incidentCategoriesMapping: Record<IncidentCategory, number>;
3667
-
3668
- /**
3669
- * Traffic incident category type.
3670
- *
3671
- * @remarks
3672
- * Represents the type of traffic incident affecting road conditions.
3673
- * Used for filtering and categorizing incidents displayed on the map.
3674
- *
3675
- * Available categories:
3676
- * - `unknown` - Unclassified incident
3677
- * - `accident` - Vehicle collision or crash
3678
- * - `fog` - Low visibility due to fog
3679
- * - `dangerous_conditions` - Hazardous road conditions
3680
- * - `rain` - Heavy rain affecting traffic
3681
- * - `ice` - Icy road conditions
3682
- * - `jam` - Traffic congestion or standstill
3683
- * - `lane_closed` - One or more lanes unavailable
3684
- * - `road_closed` - Complete road closure
3685
- * - `road_works` - Construction or maintenance
3686
- * - `wind` - Strong winds affecting traffic
3687
- * - `flooding` - Water on roadway
3688
- * - `broken_down_vehicle` - Disabled vehicle blocking traffic
3689
- *
3690
- * @group Traffic Incidents
3691
- */
3692
- export declare type IncidentCategory = (typeof incidentCategories)[number];
3693
-
3694
3861
  /**
3695
3862
  * Common configuration for traffic incident visualization components.
3696
3863
  *
@@ -5699,7 +5866,7 @@ export declare type POIsModuleConfig = MapModuleCommonConfig & {
5699
5866
  */
5700
5867
  export declare type POIsModuleFeature = Omit<MapGeoJSONFeature, 'properties'> & {
5701
5868
  /**
5702
- * POI-specific properties from the vector tile.
5869
+ * POI-specific properties from the vector tile data.
5703
5870
  */
5704
5871
  properties: {
5705
5872
  /**
@@ -5772,6 +5939,39 @@ declare type PoIsSourcesAndLayers = {
5772
5939
  */
5773
5940
  export declare const preparePlacesForDisplay: (placesInput: Place | Place[] | Places_2, instanceIndex: number, config?: PlacesModuleConfig) => Places_2<DisplayPlaceProps>;
5774
5941
 
5942
+ /**
5943
+ * Prepares the output of `calculateReachableRanges` for display with {@link GeometriesModule}.
5944
+ *
5945
+ * Derives labels from each feature's `budget` property by default, applies theme-specific
5946
+ * geometry, and preserves the bounding box. Pass the returned value directly to `module.show()`.
5947
+ *
5948
+ * Note: when using {@link reachableRangeGeometryConfig} this is called automatically — you only
5949
+ * need this function for explicit control over labels or theme.
5950
+ *
5951
+ * Features must be ordered **largest budget first** (e.g. 30 min, 20 min, 10 min).
5952
+ *
5953
+ * @param result Raw output of `calculateReachableRanges`.
5954
+ * @param theme Visual theme. Defaults to `'filled'`.
5955
+ * @param label Custom label generator; when omitted, labels derived from `budget` property.
5956
+ *
5957
+ * @example
5958
+ * ```typescript
5959
+ * // explicit control:
5960
+ * module.show(prepareReachableRangesForDisplay(result, 'inverted'));
5961
+ * module.show(prepareReachableRangesForDisplay(result, 'filled', (f) => myLabel(f)));
5962
+ * ```
5963
+ *
5964
+ * @group Geometries
5965
+ */
5966
+ export declare const prepareReachableRangesForDisplay: (result: PolygonFeatures, theme?: GeometryTheme, label?: ReachableRangeLabelFn) => PolygonFeatures;
5967
+
5968
+ /**
5969
+ * Likelihood of a traffic incident occurring.
5970
+ *
5971
+ * @group Traffic
5972
+ */
5973
+ export declare type ProbabilityOfOccurrence = 'certain' | 'probable' | 'risk_of' | 'improbable';
5974
+
5775
5975
  /**
5776
5976
  * Parameters to update the event state of a feature programmatically.
5777
5977
  *
@@ -5850,6 +6050,31 @@ export declare type PutEventStateOptions = ByIdOrIndex & {
5850
6050
  show?: boolean;
5851
6051
  };
5852
6052
 
6053
+ /**
6054
+ * Returns a {@link GeometriesModuleConfig} for reachable ranges.
6055
+ *
6056
+ * Builds on {@link themedGeometryConfig} and overrides `transformFeaturesForDisplay` so the
6057
+ * raw output of `calculateReachableRanges` can be passed directly to {@link GeometriesModule.show}
6058
+ * — labels are derived from each feature's `budget` property.
6059
+ *
6060
+ * @param palette Color palette. Defaults to `'fadedRainbow'`.
6061
+ * @param theme Visual theme. Defaults to `'filled'`.
6062
+ * @param label Custom label generator; when omitted, labels are derived from `budget` property.
6063
+ *
6064
+ * @example
6065
+ * ```typescript
6066
+ * const module = await GeometriesModule.get(map, reachableRangeGeometryConfig());
6067
+ * const result = await calculateReachableRanges([...]);
6068
+ * module.show(result); // labels and theme applied automatically
6069
+ * ```
6070
+ *
6071
+ * @group Geometries
6072
+ */
6073
+ export declare const reachableRangeGeometryConfig: (palette?: ColorPaletteOptions, theme?: GeometryTheme, label?: ReachableRangeLabelFn) => GeometriesModuleConfig;
6074
+
6075
+ /** Custom label generator for reachable range features. */
6076
+ export declare type ReachableRangeLabelFn = (feature: PolygonFeature, index: number) => string;
6077
+
5853
6078
  /**
5854
6079
  * Available road hierarchy category identifiers.
5855
6080
  *
@@ -5859,7 +6084,7 @@ export declare type PutEventStateOptions = ByIdOrIndex & {
5859
6084
  *
5860
6085
  * @group Traffic
5861
6086
  */
5862
- export declare const roadCategories: readonly ["motorway", "trunk", "primary", "secondary", "tertiary", "street"];
6087
+ export declare const roadCategories: readonly ["motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link", "secondary", "secondary_link", "tertiary", "tertiary_link", "street", "service", "track"];
5863
6088
 
5864
6089
  /**
5865
6090
  * Road hierarchy category type.
@@ -5869,17 +6094,29 @@ export declare const roadCategories: readonly ["motorway", "trunk", "primary", "
5869
6094
  * Used for filtering traffic data display based on road significance.
5870
6095
  *
5871
6096
  * Road hierarchy (from highest to lowest):
5872
- * - `motorway` - High-capacity highways with restricted access
5873
- * - `trunk` - Major inter-city roads
5874
- * - `primary` - Primary through routes
5875
- * - `secondary` - Secondary through routes
5876
- * - `tertiary` - Connecting roads (see {@link TertiaryRoadCategory})
5877
- * - `street` - Local streets (see {@link StreetRoadCategory})
6097
+ * - `motorway` / `motorway_link` - High-capacity highways with restricted access
6098
+ * - `trunk` / `trunk_link` - Major inter-city roads
6099
+ * - `primary` / `primary_link` - Primary through routes
6100
+ * - `secondary` / `secondary_link` - Secondary through routes
6101
+ * - `tertiary` / `tertiary_link` - Connecting roads
6102
+ * - `street` - Local streets (see {@link StreetRoadSubCategory})
6103
+ * - `service` - Service roads (see {@link ServiceRoadSubCategory})
6104
+ * - `track` - Unpaved or agricultural tracks
5878
6105
  *
5879
6106
  * @group Traffic
5880
6107
  */
5881
6108
  export declare type RoadCategory = (typeof roadCategories)[number];
5882
6109
 
6110
+ /**
6111
+ * Road sub-category type.
6112
+ *
6113
+ * @remarks
6114
+ * Combines street and service sub-categories. Only `street` and `service` road categories have sub-categories.
6115
+ *
6116
+ * @group Traffic
6117
+ */
6118
+ export declare type RoadSubCategory = StreetRoadSubCategory | ServiceRoadSubCategory;
6119
+
5883
6120
  /**
5884
6121
  * Main route line foreground color.
5885
6122
  * @ignore
@@ -6727,6 +6964,31 @@ declare type RoutingSourcesWithLayers = {
6727
6964
  */
6728
6965
  export declare const SELECTED_ROUTE_FILTER: ExpressionSpecification;
6729
6966
 
6967
+ /**
6968
+ * Available service road sub-category identifiers.
6969
+ *
6970
+ * @remarks
6971
+ * Provides finer granularity for classifying service roads.
6972
+ *
6973
+ * @group Traffic
6974
+ */
6975
+ export declare const serviceRoadSubCategories: readonly ["parking", "driveway", "alley"];
6976
+
6977
+ /**
6978
+ * Service road sub-category type.
6979
+ *
6980
+ * @remarks
6981
+ * Further classifies `service` roads into specific sub-types.
6982
+ *
6983
+ * Sub-categories:
6984
+ * - `parking` - Roads within parking areas
6985
+ * - `driveway` - Private access roads
6986
+ * - `alley` - Narrow back-access lanes
6987
+ *
6988
+ * @group Traffic
6989
+ */
6990
+ export declare type ServiceRoadSubCategory = (typeof serviceRoadSubCategories)[number];
6991
+
6730
6992
  /**
6731
6993
  * Optional parameters when showing routes on the map.
6732
6994
  *
@@ -7021,21 +7283,22 @@ export declare const STOP_DISPLAY_INDEX = "stopDisplayIndex";
7021
7283
  *
7022
7284
  * @group Traffic
7023
7285
  */
7024
- export declare const streetRoadCategories: readonly ["local", "minor_local"];
7286
+ export declare const streetRoadSubCategories: readonly ["unclassified", "residential", "living_street"];
7025
7287
 
7026
7288
  /**
7027
7289
  * Street road sub-category type.
7028
7290
  *
7029
7291
  * @remarks
7030
- * Further classifies local streets into specific sub-types for more granular filtering.
7292
+ * Further classifies `street` roads into specific sub-types.
7031
7293
  *
7032
7294
  * Sub-categories:
7033
- * - `local` - Standard local streets
7034
- * - `minor_local` - Minor residential streets
7295
+ * - `unclassified` - Unclassified local roads
7296
+ * - `residential` - Roads in residential areas
7297
+ * - `living_street` - Pedestrian-priority shared streets
7035
7298
  *
7036
7299
  * @group Traffic
7037
7300
  */
7038
- export declare type StreetRoadCategory = (typeof streetRoadCategories)[number];
7301
+ export declare type StreetRoadSubCategory = (typeof streetRoadSubCategories)[number];
7039
7302
 
7040
7303
  /**
7041
7304
  * Handler interface for responding to map style changes.
@@ -7248,28 +7511,26 @@ export declare type SVGIconStyleOptions = {
7248
7511
  export declare type SymbolLayerSpecWithoutSource = Omit<SymbolLayerSpecification, 'source'>;
7249
7512
 
7250
7513
  /**
7251
- * Available tertiary road sub-category identifiers.
7514
+ * Config for themed polygon display with palette-based coloring.
7252
7515
  *
7253
- * @remarks
7254
- * Provides finer granularity for classifying tertiary roads.
7516
+ * Includes data-driven expressions so each feature's `theme` property controls its
7517
+ * styling, line labels config, and positions layers below map labels.
7255
7518
  *
7256
- * @group Traffic
7519
+ * For reachable ranges, use {@link reachableRangeGeometryConfig} which extends this
7520
+ * with auto-generated labels.
7521
+ *
7522
+ * @param palette Color palette for polygon fills. Defaults to `'fadedRainbow'`.
7523
+ *
7524
+ * @group Geometries
7257
7525
  */
7258
- export declare const tertiaryRoadCategories: readonly ["connecting", "major_local"];
7526
+ export declare const themedGeometryConfig: (palette?: ColorPaletteOptions) => GeometriesModuleConfig;
7259
7527
 
7260
7528
  /**
7261
- * Tertiary road sub-category type.
7262
- *
7263
- * @remarks
7264
- * Further classifies tertiary roads into specific sub-types for more granular filtering.
7265
- *
7266
- * Sub-categories:
7267
- * - `connecting` - Roads connecting different areas
7268
- * - `major_local` - Major roads within local areas
7529
+ * Whether the incident is currently active or expected in the future.
7269
7530
  *
7270
7531
  * @group Traffic
7271
7532
  */
7272
- export declare type TertiaryRoadCategory = (typeof tertiaryRoadCategories)[number];
7533
+ export declare type TimeValidity = 'present' | 'future';
7273
7534
 
7274
7535
  /**
7275
7536
  * @ignore
@@ -7999,16 +8260,16 @@ export declare type TrafficCommonFilter = {
7999
8260
  * Filters traffic data by road sub-categories.
8000
8261
  *
8001
8262
  * @remarks
8002
- * Provides finer-grained control for tertiary roads and streets.
8003
- * Applies to sub-categories of {@link TertiaryRoadCategory} and {@link StreetRoadCategory}.
8263
+ * Provides finer-grained control for street and service roads.
8264
+ * Applies to sub-categories of {@link StreetRoadSubCategory} and {@link ServiceRoadSubCategory}.
8004
8265
  *
8005
8266
  * @example
8006
8267
  * ```ts
8007
8268
  * // Hide minor local streets
8008
- * roadSubCategories: { show: 'all_except', values: ['minor_local'] }
8269
+ * roadSubCategories: { show: 'all_except', values: ['living_street'] }
8009
8270
  * ```
8010
8271
  */
8011
- roadSubCategories?: ValuesFilter<TertiaryRoadCategory | StreetRoadCategory>;
8272
+ roadSubCategories?: ValuesFilter<RoadSubCategory>;
8012
8273
  };
8013
8274
 
8014
8275
  /**
@@ -8324,15 +8585,62 @@ export declare class TrafficFlowModule extends AbstractMapModule<TrafficFlowSour
8324
8585
  * ```
8325
8586
  */
8326
8587
  getShown(): {
8327
- trafficFlow: MapGeoJSONFeature[];
8588
+ trafficFlow: TrafficFlowModuleFeature[];
8328
8589
  };
8329
8590
  /**
8330
8591
  * Create the events on/off for this module
8331
8592
  * @returns An instance of EventsModule
8332
8593
  */
8333
- get events(): EventsModule<MapGeoJSONFeature>;
8594
+ get events(): EventsModule<TrafficFlowModuleFeature>;
8334
8595
  }
8335
8596
 
8597
+ /**
8598
+ * Defines the structure of a traffic flow feature, which extends the basic GeoJSON feature
8599
+ * with properties extracted from the traffic flow vector tiles.
8600
+ *
8601
+ * @group Traffic Flow
8602
+ */
8603
+ export declare type TrafficFlowModuleFeature = Omit<MapGeoJSONFeature, 'properties'> & {
8604
+ properties: {
8605
+ /**
8606
+ * Road hierarchy category type.
8607
+ */
8608
+ roadCategory: RoadCategory;
8609
+ /**
8610
+ * Road hierarchy subcategory type. Only present for `street` and `service` road categories.
8611
+ */
8612
+ roadSubcategory?: RoadSubCategory;
8613
+ /**
8614
+ * Speed relative to free-flow traffic, ranging from 0.00 (standstill) to 1.00 (free flow).
8615
+ */
8616
+ relativeSpeed: number;
8617
+ /**
8618
+ * Indicates whether the road segment is in a left-hand traffic region.
8619
+ */
8620
+ leftHandTraffic: boolean;
8621
+ /**
8622
+ * Indicates whether the road segment is closed to traffic.
8623
+ */
8624
+ roadClosure: boolean;
8625
+ /**
8626
+ * Absolute speed in kilometers per hour.
8627
+ */
8628
+ absoluteSpeed?: number;
8629
+ /**
8630
+ * Indicates whether the flow covers different directional geometries (i.e. both directions of a two-way road).
8631
+ */
8632
+ partOfTwoWayRoad?: boolean;
8633
+ /**
8634
+ * OpenLR code describing the location of the flow section.
8635
+ */
8636
+ openlr?: string;
8637
+ /**
8638
+ * Positive integer ranking the importance of the road segment.
8639
+ */
8640
+ displayClass?: number;
8641
+ };
8642
+ };
8643
+
8336
8644
  /**
8337
8645
  * IDs of sources and layers for traffic flow module.
8338
8646
  */
@@ -8359,10 +8667,10 @@ export declare type TrafficIncidentsFilter = TrafficCommonFilter & {
8359
8667
  * @example
8360
8668
  * ```ts
8361
8669
  * // Show only accidents and road closures
8362
- * incidentCategories: { show: 'only', values: ['accident', 'road_closed'] }
8670
+ * incidentCategories: { show: 'only', values: ['accident', 'road-closed'] }
8363
8671
  * ```
8364
8672
  */
8365
- incidentCategories?: ValuesFilter<IncidentCategory>;
8673
+ incidentCategories?: ValuesFilter<TrafficIncidentCategory>;
8366
8674
  /**
8367
8675
  * Filters incidents by delay severity magnitude.
8368
8676
  *
@@ -8414,7 +8722,7 @@ export declare type TrafficIncidentsFilter = TrafficCommonFilter & {
8414
8722
  * filters: {
8415
8723
  * any: [
8416
8724
  * { magnitudes: { show: 'only', values: ['major'] } },
8417
- * { incidentCategories: { show: 'only', values: ['road_closed'] } }
8725
+ * { incidentCategories: { show: 'only', values: ['road-closed'] } }
8418
8726
  * ]
8419
8727
  * }
8420
8728
  * ```
@@ -8481,7 +8789,7 @@ export declare type TrafficIncidentsFilters = {
8481
8789
  * any: [{
8482
8790
  * incidentCategories: {
8483
8791
  * show: 'only',
8484
- * values: ['accident', 'road_closed']
8792
+ * values: ['accident', 'road-closed']
8485
8793
  * }
8486
8794
  * }]
8487
8795
  * });
@@ -8491,7 +8799,7 @@ export declare type TrafficIncidentsFilters = {
8491
8799
  * any: [{
8492
8800
  * incidentCategories: {
8493
8801
  * show: 'all_except',
8494
- * values: ['road_works']
8802
+ * values: ['roadworks']
8495
8803
  * }
8496
8804
  * }]
8497
8805
  * });
@@ -8578,7 +8886,7 @@ export declare class TrafficIncidentsModule extends AbstractMapModule<TrafficInc
8578
8886
  * any: [{
8579
8887
  * incidentCategories: {
8580
8888
  * show: 'only',
8581
- * values: ['accident', 'road_closed', 'jam']
8889
+ * values: ['accident', 'road-closed', 'jam']
8582
8890
  * }
8583
8891
  * }]
8584
8892
  * }
@@ -8612,13 +8920,13 @@ export declare class TrafficIncidentsModule extends AbstractMapModule<TrafficInc
8612
8920
  * - `roadSubCategories`: Filter by specific road types
8613
8921
  *
8614
8922
  * **Available Incident Categories:**
8615
- * - `accident`, `road_closed`, `lane_closed`
8616
- * - `road_works` (construction)
8923
+ * - `accident`, `road-closed`, `lane-closed`
8924
+ * - `roadworks` (construction)
8617
8925
  * - `jam` (traffic jam)
8618
- * - `fog`, `rain`, `ice`, `wind`, `flooding`
8619
- * - `dangerous_conditions`
8620
- * - `broken_down_vehicle`
8621
- * - `unknown`
8926
+ * - `fog`, `rain`, `frost`, `wind`, `flooding`
8927
+ * - `danger`, `animals-on-road`, `narrow-lanes`
8928
+ * - `broken-down-vehicle`
8929
+ * - `other`
8622
8930
  *
8623
8931
  * **Delay Magnitudes:**
8624
8932
  * - `minor`: Small delays
@@ -8633,7 +8941,7 @@ export declare class TrafficIncidentsModule extends AbstractMapModule<TrafficInc
8633
8941
  * any: [{
8634
8942
  * incidentCategories: {
8635
8943
  * show: 'only',
8636
- * values: ['accident', 'road_closed']
8944
+ * values: ['accident', 'road-closed']
8637
8945
  * }
8638
8946
  * }]
8639
8947
  * });
@@ -8775,15 +9083,101 @@ export declare class TrafficIncidentsModule extends AbstractMapModule<TrafficInc
8775
9083
  * ```
8776
9084
  */
8777
9085
  getShown(): {
8778
- trafficIncidents: MapGeoJSONFeature[];
9086
+ trafficIncidents: TrafficIncidentsModuleFeature[];
8779
9087
  };
8780
9088
  /**
8781
9089
  * Create the events on/off for this module
8782
9090
  * @returns An instance of EventsModule
8783
9091
  */
8784
- get events(): EventsModule<MapGeoJSONFeature>;
9092
+ get events(): EventsModule<TrafficIncidentsModuleFeature>;
8785
9093
  }
8786
9094
 
9095
+ /**
9096
+ * Defines the structure of a traffic incident feature, which extends the basic GeoJSON feature with specific properties related to traffic incidents. This type is used to represent individual traffic incidents on the map, providing details such as the description of the incident, its severity, and the road category where it is occurring.
9097
+ */
9098
+ export declare type TrafficIncidentsModuleFeature = Omit<MapGeoJSONFeature, 'properties'> & {
9099
+ /**
9100
+ * Properties specific to traffic incidents, extracted from the vector tile data.
9101
+ *
9102
+ * @remarks
9103
+ * These properties include a unique identifier for the incident, a description of the incident, its category, the magnitude of any resulting delay, and information about the road where the incident is occurring (including road category and subcategory). Additionally, it indicates whether the incident is in a left-hand traffic region.
9104
+ */
9105
+ properties: {
9106
+ /**
9107
+ * Unique identifier for the traffic incident, common across Traffic API services.
9108
+ */
9109
+ id: string;
9110
+ /**
9111
+ * Description of the traffic incident, providing details about the nature of the incident.
9112
+ */
9113
+ description: string;
9114
+ /**
9115
+ * Category of the traffic incident, classifying the type of incident (e.g., accident, roadworks, congestion) based on predefined categories.
9116
+ */
9117
+ category: TrafficIncidentCategory;
9118
+ /**
9119
+ * Severity of the delay.
9120
+ */
9121
+ magnitudeOfDelay: DelayMagnitude;
9122
+ /**
9123
+ * The delay caused by the incident in seconds (except in road closures). It is calculated against free-flow travel time (the travel time when the traffic is minimal, e.g., night traffic).
9124
+ */
9125
+ delayInSeconds?: number;
9126
+ /**
9127
+ * Road hierarchy category type.
9128
+ */
9129
+ roadCategory: RoadCategory;
9130
+ /**
9131
+ * Road hierarchy subcategory type, providing more specific classification of the road where the incident is occurring.
9132
+ */
9133
+ roadSubcategory: RoadSubCategory;
9134
+ /**
9135
+ * Indicates whether the traffic incident is occurring in a left-hand traffic region.
9136
+ */
9137
+ leftHandTraffic: boolean;
9138
+ /**
9139
+ * Indicates whether the incident covers different directional geometries (i.e. both directions of a two-way road).
9140
+ */
9141
+ partOfTwoWayRoad?: boolean;
9142
+ /**
9143
+ * The date and time when the incident started.
9144
+ */
9145
+ startTime?: Date;
9146
+ /**
9147
+ * The estimated date and time when the incident will end.
9148
+ */
9149
+ endTime?: Date;
9150
+ /**
9151
+ * Likelihood assessment of the incident occurring.
9152
+ */
9153
+ probabilityOfOccurrence?: ProbabilityOfOccurrence;
9154
+ /**
9155
+ * Number of user reports for the incident.
9156
+ */
9157
+ numberOfReports?: number;
9158
+ /**
9159
+ * The date and time of the most recent user report for the incident.
9160
+ */
9161
+ lastReportTime?: Date;
9162
+ /**
9163
+ * Average speed within the incident area, in km/h.
9164
+ */
9165
+ averageSpeedKmph?: number;
9166
+ /**
9167
+ * OpenLR code describing the location of the incident.
9168
+ */
9169
+ openlr?: string;
9170
+ /**
9171
+ * Whether the incident is currently active or expected in the future.
9172
+ */
9173
+ timeValidity?: TimeValidity;
9174
+ /**
9175
+ * Positive integer ranking the importance of the road where the incident occurs.
9176
+ */
9177
+ displayClass?: number;
9178
+ };
9179
+ };
9180
+
8787
9181
  /**
8788
9182
  * IDs of sources and layers for traffic incidents module.
8789
9183
  */