@tomtom-org/maps-sdk 0.32.3 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -206,7 +206,7 @@ export declare type Anything = {
206
206
  * // Route will pass within 2km of Amsterdam center
207
207
  * ```
208
208
  *
209
- * @see [Waypoints Guide](https://docs.tomtom.com/maps-sdk-js/guides/services/routing/waypoints)
209
+ * @see [Locations Guide](https://docs.tomtom.com/maps-sdk-js/guides/services/routing/locations)
210
210
  *
211
211
  * @group Route
212
212
  */
@@ -392,30 +392,6 @@ export declare const bboxFromGeoJSON: (hasBBox: HasBBox) => OptionalBBox;
392
392
  */
393
393
  export declare const bboxOnlyIfWithArea: (bbox: OptionalBBox) => OptionalBBox;
394
394
 
395
- /**
396
- * Brand information for a POI.
397
- *
398
- * Identifies the commercial brand or chain associated with a location.
399
- * Useful for finding specific franchise locations or filtering by brand.
400
- *
401
- * @example
402
- * ```typescript
403
- * const brand: Brand = {
404
- * name: 'Starbucks'
405
- * };
406
- * ```
407
- *
408
- * @group Place
409
- */
410
- export declare type Brand = {
411
- /**
412
- * Brand name.
413
- *
414
- * The commercial or franchise name (e.g., 'McDonald\'s', 'Shell', 'Hilton').
415
- */
416
- name: string;
417
- };
418
-
419
395
  /**
420
396
  * Traffic incident cause based on TPEG2-TEC standard.
421
397
  *
@@ -560,7 +536,7 @@ export declare type ChargingPark = {
560
536
  * For real-time availability, use the availability property instead.
561
537
  * This field shows total counts regardless of current operational status.
562
538
  */
563
- connectorCounts: Omit<ConnectorAvailability, 'statusCounts'>[];
539
+ connectorCounts: ConnectorCount[];
564
540
  };
565
541
 
566
542
  /**
@@ -719,15 +695,7 @@ export declare type ChargingPoint = {
719
695
  *
720
696
  * @group Place
721
697
  */
722
- export declare type ChargingPointAvailability = {
723
- /**
724
- * Total number of charging points or connectors.
725
- *
726
- * Depends on context:
727
- * - For ChargingPointAvailability: total number of charging points
728
- * - For ConnectorAvailability: total number of connectors of this type
729
- */
730
- count: number;
698
+ export declare type ChargingPointAvailability = HasCount & {
731
699
  /**
732
700
  * Breakdown of units by operational status.
733
701
  *
@@ -839,7 +807,13 @@ export declare type ChargingPointStatus = (typeof chargingPointStatus)[number];
839
807
  export declare const chargingPointStatus: readonly ["Available", "Reserved", "Occupied", "OutOfService", "Unknown"];
840
808
 
841
809
  /**
842
- * @group Route
810
+ * The charging speed classification of this charging connection.
811
+ *
812
+ * @remarks
813
+ * - `slow`: Typically up to 12 kW (Level 1 AC charging)
814
+ * - `regular`: Typically between 12 kW and 50 kW (Level 2 AC charging)
815
+ * - `fast`: Typically between 50 kW and 150 kW (DC fast charging)
816
+ * - `ultra-fast`: Typically above 150 kW (High-power DC fast charging)
843
817
  */
844
818
  export declare type ChargingSpeed = 'slow' | 'regular' | 'fast' | 'ultra-fast';
845
819
 
@@ -1402,6 +1376,16 @@ export declare type Connector = {
1402
1376
  * - 150-350 kW: DC ultra-fast charging
1403
1377
  */
1404
1378
  ratedPowerKW: number;
1379
+ /**
1380
+ * The charging speed classification of this charging connection.
1381
+ *
1382
+ * @remarks
1383
+ * - `slow`: Typically up to 12 kW (Level 1 AC charging)
1384
+ * - `regular`: Typically between 12 kW and 50 kW (Level 2 AC charging)
1385
+ * - `fast`: Typically between 50 kW and 150 kW (DC fast charging)
1386
+ * - `ultra-fast`: Typically above 150 kW (High-power DC fast charging)
1387
+ */
1388
+ chargingSpeed: ChargingSpeed;
1405
1389
  /**
1406
1390
  * Voltage in volts (V).
1407
1391
  *
@@ -1445,15 +1429,14 @@ export declare type Connector = {
1445
1429
  *
1446
1430
  * @group Place
1447
1431
  */
1448
- export declare type ConnectorAvailability = ChargingPointAvailability & {
1449
- /**
1450
- * Connector specifications for this availability group.
1451
- *
1452
- * All connectors in this availability group share these specifications
1453
- * (same type, power rating, voltage, etc.).
1454
- */
1455
- connector: Connector;
1456
- };
1432
+ export declare type ConnectorAvailability = HasConnector & ChargingPointAvailability;
1433
+
1434
+ /**
1435
+ * Count information for a specific connector type.
1436
+ *
1437
+ * @group Place
1438
+ */
1439
+ export declare type ConnectorCount = HasConnector & HasCount;
1457
1440
 
1458
1441
  /**
1459
1442
  * Electric vehicle charging connector type.
@@ -2351,6 +2334,30 @@ export declare type Guidance = {
2351
2334
  */
2352
2335
  export declare type HasBBox = BBox | GeoJsonObject | GeoJsonObject[];
2353
2336
 
2337
+ /**
2338
+ * Has an Electric vehicle charging connector.
2339
+ *
2340
+ * @group Place
2341
+ */
2342
+ export declare type HasConnector = {
2343
+ /**
2344
+ * Electric vehicle charging connector.
2345
+ */
2346
+ connector: Connector;
2347
+ };
2348
+
2349
+ /**
2350
+ * Has a number representing a count.
2351
+ *
2352
+ * @group Place
2353
+ */
2354
+ export declare type HasCount = {
2355
+ /**
2356
+ * Number representing the count of items.
2357
+ */
2358
+ count: number;
2359
+ };
2360
+
2354
2361
  /**
2355
2362
  * Input type representing a geographic point location.
2356
2363
  *
@@ -3620,7 +3627,7 @@ export declare type RoadInformation = {
3620
3627
  * Lists the road shields for this road.
3621
3628
  * The list can be empty if no road shields are available.
3622
3629
  */
3623
- roadShields: RoadShield[];
3630
+ roadShields?: RoadShield[];
3624
3631
  };
3625
3632
 
3626
3633
  /**
@@ -3645,7 +3652,7 @@ export declare type RoadShield = {
3645
3652
  * Information allowing the client to build an image of the road shield using the TomTom RoadShield API.
3646
3653
  * Included if instructionRoadShieldReferences was requested.
3647
3654
  */
3648
- roadShieldReference: RoadShieldReference;
3655
+ roadShieldReference?: RoadShieldReference;
3649
3656
  /**
3650
3657
  * The state code of the state the shield is in (second part of an ISO 3166-2 identifier).
3651
3658
  * Included if state codes are available for the country the road shield is located in.
@@ -3673,7 +3680,7 @@ export declare type RoadShieldReference = {
3673
3680
  /**
3674
3681
  * An optional list of possible affixes that can be shown in addition to the shieldContent.
3675
3682
  */
3676
- affixes: string[];
3683
+ affixes?: string[];
3677
3684
  };
3678
3685
 
3679
3686
  /**
@@ -4178,6 +4185,30 @@ export declare type SummaryBase = {
4178
4185
  * Only included if requested using the computeTravelTimeFor parameter.
4179
4186
  */
4180
4187
  liveTrafficIncidentsTravelTimeInSeconds?: number;
4188
+ /**
4189
+ * The distance (in meters) from the origin point to the first point where this route forks off from the reference route.
4190
+ *
4191
+ * @remarks
4192
+ * * If the route is identical to the reference route, then this field is set to the length of the route.
4193
+ * * Included in all alternative (but not reference) route summary fields.
4194
+ */
4195
+ deviationDistanceInMeters?: number;
4196
+ /**
4197
+ * The travel time (in seconds) from the origin point to the first point where this route forks off from the reference route.
4198
+ *
4199
+ * @remarks
4200
+ * * If the route is identical to the reference route, then this field is set to the estimated travel time of the route.
4201
+ * * Included in all alternative (but not reference) route summary fields.
4202
+ */
4203
+ deviationTimeInSeconds?: number;
4204
+ /**
4205
+ * The coordinates of the first point where this route forks off from the reference route.
4206
+ *
4207
+ * @remarks
4208
+ * * If the route is identical to the reference route, then this field is set to the coordinates of the last point on the route.
4209
+ * * Included in all alternative (but not reference) route summary fields.
4210
+ */
4211
+ deviationPoint?: Position;
4181
4212
  };
4182
4213
 
4183
4214
  /**
@@ -4201,11 +4232,11 @@ export declare type TextWithPhonetics = {
4201
4232
  * Included if phonetic transcription is available for the specific name, and phonetic transcriptions have been requested by the client.
4202
4233
  * Note: The phonetic transcription can contain double quote characters ("). In this case those characters are escaped with a backslash (\).
4203
4234
  */
4204
- phonetic: string;
4235
+ phonetic?: string;
4205
4236
  /**
4206
4237
  * Encodes the language using an IETF language tag, e.g., en-GB, en-US.
4207
4238
  */
4208
- phoneticLanguageCode: string;
4239
+ phoneticLanguageCode?: string;
4209
4240
  };
4210
4241
 
4211
4242
  /**
@@ -4447,7 +4478,7 @@ export declare type TrafficIncidentTEC = {
4447
4478
  *
4448
4479
  * TPEG2-TEC standard code indicating how traffic is affected.
4449
4480
  */
4450
- effectCode: number;
4481
+ effectCode?: number;
4451
4482
  /**
4452
4483
  * List of causes for this traffic incident.
4453
4484
  *
@@ -63,7 +63,7 @@ terms above.
63
63
  ---
64
64
 
65
65
  Name: @tomtom-org/maps-sdk
66
- Version: 0.32.3
66
+ Version: 0.34.0
67
67
  License: See in LICENSE.txt
68
68
  Private: false
69
69
  Description: TomTom Maps for JavaScript
@@ -29,6 +29,7 @@ import { MapOptions } from 'maplibre-gl';
29
29
  import { Place } from '../../../../core';
30
30
  import { Place as Place_2 } from '../../../core';
31
31
  import { Places } from '../../../core';
32
+ import { Places as Places_2 } from '../../../../core';
32
33
  import { POICategory } from '../../../core';
33
34
  import { Point } from 'geojson';
34
35
  import { PolygonFeatures } from '../../../core';
@@ -948,8 +949,9 @@ declare type BaseSourceAndLayers = {
948
949
  /**
949
950
  * Builds the title of the place to display it on the map.
950
951
  * @param place The place to display.
952
+ * @ignore
951
953
  */
952
- export declare const buildPlaceTitle: (place: Place_2) => string;
954
+ export declare const buildPlaceTitle: (place: Place) => string;
953
955
 
954
956
  /**
955
957
  * Generates the routing layers configuration for route visualization on the map.
@@ -1036,7 +1038,7 @@ export declare type ChargingStopIconMapping = {
1036
1038
  /**
1037
1039
  * The function which maps a ChargingStop to a sprite image ID.
1038
1040
  */
1039
- fn: ToStringFn<ChargingStop>;
1041
+ fn: (stop: ChargingStop) => string;
1040
1042
  };
1041
1043
 
1042
1044
  /**
@@ -1386,6 +1388,40 @@ export declare type CustomStyle = {
1386
1388
  json?: StyleSpecification;
1387
1389
  };
1388
1390
 
1391
+ /**
1392
+ * Configuration for the default place icon.
1393
+ * * This is the icon that is used for clicked locations and addresses without a specific category.
1394
+ *
1395
+ * @group Places
1396
+ */
1397
+ export declare type DefaultPlaceIconConfig = {
1398
+ /**
1399
+ * Base style options for the SVG default icon.
1400
+ *
1401
+ * @remarks
1402
+ * Use this to set the fill color, outline color, and outline opacity for the default waypoint icon.
1403
+ *
1404
+ * Example:
1405
+ * ```typescript
1406
+ * baseStyle: {
1407
+ * fillColor: '#007AFF',
1408
+ * outlineColor: '#FFFFFF',
1409
+ * outlineOpacity: 0.8
1410
+ * }
1411
+ * ```
1412
+ */
1413
+ style?: SVGIconStyleOptions;
1414
+ /**
1415
+ * Custom image for the default icon.
1416
+ *
1417
+ * @remarks
1418
+ * If provided, this image will be used instead of the default icon.
1419
+ *
1420
+ * If an SVG image is provided, the 'style' options can still apply. Otherwise, 'style' is ignored.
1421
+ */
1422
+ image?: Omit<CustomImage, 'id'>;
1423
+ };
1424
+
1389
1425
  /**
1390
1426
  * Default routing layers configuration. Calls routingLayers with no parameters.
1391
1427
  *
@@ -3061,16 +3097,15 @@ export declare type GeometryTextConfig = {
3061
3097
 
3062
3098
  /**
3063
3099
  * Gets the map style sprite image ID to display on the map for the give place.
3064
- * @param place The place to display.
3065
- * @param config
3100
+ * @ignore
3066
3101
  */
3067
- export declare const getIconIDForPlace: (place: Place_2, config?: PlacesModuleConfig) => string;
3102
+ export declare const getIconIDForPlace: (place: Place, instanceIndex: number, config?: PlacesModuleConfig) => string;
3068
3103
 
3069
3104
  /**
3070
3105
  * Maps a Place category to the poi layer one, so the latter's style can apply it.
3071
3106
  * @ignore
3072
3107
  */
3073
- export declare const getPOILayerCategoryForPlace: (place: Place_2) => string | undefined;
3108
+ export declare const getPOILayerCategoryForPlace: (place: Place) => string | undefined;
3074
3109
 
3075
3110
  /**
3076
3111
  * Gets the specified filtered categories icon IDs to be used in map filtering.
@@ -3337,6 +3372,11 @@ declare type HillshadeSourcesWithLayers = {
3337
3372
  */
3338
3373
  export declare type HoverEventType = 'hover' | 'long-hover';
3339
3374
 
3375
+ /**
3376
+ * @ignore
3377
+ */
3378
+ export declare const imageIDWithInstanceSuffix: (baseID: string, instanceIndex: number) => string;
3379
+
3340
3380
  /**
3341
3381
  * Available traffic incident category identifiers.
3342
3382
  *
@@ -3446,6 +3486,14 @@ export declare type LayerSpecTemplate<L extends LayerSpecification> = Omit<L, 'i
3446
3486
  */
3447
3487
  export declare type LayerSpecWithSource = Exclude<LayerSpecification, BackgroundLayerSpecification>;
3448
3488
 
3489
+ /**
3490
+ * Indicator of a light or dark theme.
3491
+ * * Can be used to classify a map style as light or dark, or to apply light or dark configurations to map modules if they support it.
3492
+ *
3493
+ * @group Map Style
3494
+ */
3495
+ export declare type LightDark = 'light' | 'dark';
3496
+
3449
3497
  /**
3450
3498
  * @ignore
3451
3499
  */
@@ -4099,7 +4147,7 @@ export declare type PlaceDisplayProps = {
4099
4147
  * ```typescript
4100
4148
  * // Custom icons for specific categories
4101
4149
  * const iconConfig: PlaceIconConfig = {
4102
- * customIcons: [
4150
+ * categoryIcons: [
4103
4151
  * { category: 'RESTAURANT', image: '/icons/food.png', pixelRatio: 2 },
4104
4152
  * { category: 'HOTEL_MOTEL', image: '/icons/hotel.png', pixelRatio: 2 }
4105
4153
  * ]
@@ -4109,13 +4157,28 @@ export declare type PlaceDisplayProps = {
4109
4157
  * @group Places
4110
4158
  */
4111
4159
  export declare type PlaceIconConfig = {
4160
+ /**
4161
+ * Configuration for the default place icon.
4162
+ * * The default icon is the one used for clicked locations and addresses without a specific category, or via custom mapping.
4163
+ */
4164
+ default?: DefaultPlaceIconConfig;
4112
4165
  /**
4113
4166
  * Array of custom icons for specific place categories.
4114
4167
  *
4115
4168
  * When provided, places matching these categories will use the custom icons
4116
4169
  * instead of the default style.
4117
4170
  */
4118
- customIcons?: CustomImage<MapStylePOICategory>[];
4171
+ categoryIcons?: CustomImage<MapStylePOICategory>[];
4172
+ /**
4173
+ * Custom mapping function to generate the icon ID for a given place.
4174
+ *
4175
+ * @remarks
4176
+ * If provided, this function sets the iconID property on the place.
4177
+ * This allows for full control on how to determine which icon to use for each place based on its properties.
4178
+ *
4179
+ * @param place The place to generate the icon ID for.
4180
+ */
4181
+ mapping?: (place: Place) => string;
4119
4182
  };
4120
4183
 
4121
4184
  /**
@@ -4174,12 +4237,14 @@ export declare type PlaceLayersConfig = {
4174
4237
  */
4175
4238
  main?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
4176
4239
  /**
4177
- * Selected/highlighted place marker layer specification.
4240
+ * Selected place marker layer specification.
4178
4241
  *
4179
4242
  * @remarks
4180
4243
  * Controls the visual appearance of places when they are highlighted or selected
4181
4244
  * (e.g., on hover or click events). This layer is rendered on top of the main layer
4182
4245
  * to ensure selected places are always visible.
4246
+ *
4247
+ * This layer reacts to 'hover' and 'click' event states.
4183
4248
  */
4184
4249
  selected?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
4185
4250
  } & HasAdditionalLayersConfig;
@@ -4228,7 +4293,7 @@ export declare const PLACES_SOURCE_PREFIX_ID = "places";
4228
4293
  * // Create places module with pin markers
4229
4294
  * const places = await PlacesModule.get(map, {
4230
4295
  * icon: {
4231
- * customIcons: []
4296
+ * categoryIcons: []
4232
4297
  * },
4233
4298
  * text: {
4234
4299
  * field: (place) => place.properties.poi?.name || 'Unknown'
@@ -4264,6 +4329,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
4264
4329
  * @private
4265
4330
  */
4266
4331
  private instanceIndex;
4332
+ private defaultPlaceIconID;
4267
4333
  /**
4268
4334
  * Make sure the map is ready before create an instance of the module and any other interaction with the map
4269
4335
  * @param tomtomMap The TomTomMap instance.
@@ -4325,7 +4391,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
4325
4391
  * @example
4326
4392
  * ```typescript
4327
4393
  * places.applyIconConfig({
4328
- * customIcons: [
4394
+ * categoryIcons: [
4329
4395
  * { category: 'RESTAURANT', id: 'restaurant-icon', image: '/icons/food.png' }
4330
4396
  * ]
4331
4397
  * });
@@ -4378,6 +4444,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
4378
4444
  [key: string]: any;
4379
4445
  }): void;
4380
4446
  private updateLayersAndData;
4447
+ private setupImages;
4381
4448
  private updateData;
4382
4449
  /**
4383
4450
  * Displays the given places on the map.
@@ -4514,7 +4581,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
4514
4581
  * const config: PlacesModuleConfig = {
4515
4582
  * icon: {
4516
4583
  * style: 'base-map',
4517
- * customIcons: [
4584
+ * categoryIcons: [
4518
4585
  * { category: 'RESTAURANT', image: '/icons/restaurant.png' }
4519
4586
  * ]
4520
4587
  * },
@@ -4575,7 +4642,7 @@ export declare type PlacesModuleConfig = {
4575
4642
  *
4576
4643
  * @remarks
4577
4644
  * Useful for:
4578
- * - Adding computed flags for conditional styling
4645
+ * - Adding computed flags for conditional styling via 'layers' config.
4579
4646
  * - Extracting nested properties for easier access
4580
4647
  * - Adding business logic properties
4581
4648
  *
@@ -5367,7 +5434,7 @@ declare type PoIsSourcesAndLayers = {
5367
5434
  * prepare places features to be displayed on map by adding needed properties for title, icon and style
5368
5435
  * @ignore
5369
5436
  */
5370
- export declare const preparePlacesForDisplay: (placesInput: Place_2 | Place_2[] | Places, map: Map_2, config?: PlacesModuleConfig) => Places<DisplayPlaceProps>;
5437
+ export declare const preparePlacesForDisplay: (placesInput: Place | Place[] | Places_2, instanceIndex: number, config?: PlacesModuleConfig) => Places_2<DisplayPlaceProps>;
5371
5438
 
5372
5439
  /**
5373
5440
  * Parameters to update the event state of a feature programmatically.
@@ -6953,11 +7020,12 @@ export declare class TomTomMap {
6953
7020
  /**
6954
7021
  * @ignore
6955
7022
  */
6956
- _eventsProxy: EventsProxy;
7023
+ readonly _eventsProxy: EventsProxy;
6957
7024
  /**
6958
7025
  * @ignore
6959
7026
  */
6960
7027
  _params: TomTomMapParams;
7028
+ styleLightDarkTheme: LightDark;
6961
7029
  private readonly styleChangeHandlers;
6962
7030
  /**
6963
7031
  * Constructs a new TomTom Map instance and attaches it to a DOM element.
@@ -7450,17 +7518,7 @@ export declare class TomTomMapSource<SOURCE_SPEC extends SourceSpecification = S
7450
7518
  * Transforms the input of a "show" call to FeatureCollection "Places".
7451
7519
  * @ignore
7452
7520
  */
7453
- export declare const toPlaces: (places: Place_2 | Place_2[] | Places) => Places;
7454
-
7455
- /**
7456
- * Function type for mapping a value to a string, typically used for icon sprite IDs.
7457
- *
7458
- * @typeParam T - The type of the input value to be mapped to a string.
7459
- * @param key - The input value to map.
7460
- * @returns The string representation or sprite image ID for the given value.
7461
- * @group Routing
7462
- */
7463
- export declare type ToStringFn<T> = (key: T) => string;
7521
+ export declare const toPlaces: (places: Place | Place[] | Places_2) => Places_2;
7464
7522
 
7465
7523
  /**
7466
7524
  * Source identifier for traffic flow vector tiles.
@@ -8190,6 +8248,7 @@ export declare class TrafficIncidentsModule extends AbstractMapModule<TrafficInc
8190
8248
  * ```
8191
8249
  */
8192
8250
  setVisible(visible: boolean): void;
8251
+ private _setVisible;
8193
8252
  /**
8194
8253
  * Checks if any traffic incident layers are currently visible.
8195
8254
  *